Skip to content

Commit

Permalink
feat: add default export (and remove index.svelte as it is of no use)
Browse files Browse the repository at this point in the history
  • Loading branch information
arlac77 committed Jun 2, 2020
1 parent 8e58ec5 commit 2e57987
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
Svelte store with a websocket backend

```js
import { websocketStore } from 'svelte-websocket-store';
import websocketStore from 'svelte-websocket-store';

const initialValue = { };
export const myStore = websocketStore("wss://mydomain.com/ws1", initialValue, ['option 1', 'option 2']);
Expand Down
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"publishConfig": {
"access": "public"
},
"main": "src/index.mjs",
"svelte": "src/index.svelte",
"main": "./src/index.mjs",
"description": "svelte store with a websocket backend",
"keywords": [
"svelte",
Expand Down Expand Up @@ -38,9 +37,6 @@
"testcafe": "^1.8.5",
"ws": "^7.2.3"
},
"engines": {
"node": ">=14.3.0"
},
"repository": {
"type": "git",
"url": "https://github.com/arlac77/svelte-websocket-store.git"
Expand Down
6 changes: 3 additions & 3 deletions src/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ export function websocketStore(url, initialValue, socketOptions) {

return {
set(value) {
open().then(() => {
socket.send(JSON.stringify(value));
});
open().then(() => socket.send(JSON.stringify(value)));
},
subscribe(subscription) {
open();
Expand All @@ -87,3 +85,5 @@ export function websocketStore(url, initialValue, socketOptions) {
}
};
}

export default websocketStore;
4 changes: 0 additions & 4 deletions src/index.svelte

This file was deleted.

0 comments on commit 2e57987

Please sign in to comment.