Skip to content
This repository has been archived by the owner on Jun 29, 2021. It is now read-only.

Commit

Permalink
declare io internally
Browse files Browse the repository at this point in the history
  • Loading branch information
rennokki committed Feb 25, 2021
1 parent 9a503ea commit c6ce962
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ Soketi.js is a hard fork of [laravel/echo](https://github.com/laravel/echo), mea
```js
import Soketi from '@soketi/soketi-js';

window.io = require('socket.io-client');

window.Soketi = new Soketi({
host: window.location.hostname,
key: 'echo-app-key', // should be replaced with the App Key
Expand All @@ -41,10 +39,9 @@ window.Soketi = new Soketi({
});

// for example
Soketi.channel('twitter')
.listen('.tweet', e => {
console.log({ tweet: e.tweet });
});
Soketi.channel('twitter').listen('.tweet', e => {
console.log({ tweet: e.tweet });
});
```

## Authorizing Sanctum
Expand Down
3 changes: 3 additions & 0 deletions src/connector/connector.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { SoketiChannel, SoketiPresenceChannel } from './../channel';

const io = require('socket.io-client');

export abstract class Connector {
/**
* Default connector options.
Expand All @@ -18,6 +20,7 @@ export abstract class Connector {
authorizer: null,
namespace: 'App.Events',
transports: ['websocket'],
client: io,
};

/**
Expand Down

0 comments on commit c6ce962

Please sign in to comment.