Skip to content

Commit

Permalink
Merge pull request #1 from FastyBird/feature/add-into-plugin
Browse files Browse the repository at this point in the history
Add client instance into plugin object
  • Loading branch information
akadlec authored Apr 20, 2023
2 parents aeb5bb8 + c915368 commit 802dc8f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fastybird/vue-wamp-v1",
"version": "1.0.0",
"version": "1.1.0",
"description": "WAMPv1 websockets client for VUE 3",
"keywords": [
"ws",
Expand Down Expand Up @@ -40,8 +40,8 @@
"dev": "vite",
"serve": "vite preview",
"clean": "rimraf dist && rimraf tsconfig.tsbuildinfo",
"build": "yarn clean && vue-tsc --noEmit && vite build",
"types": "vue-tsc --noEmit",
"build": "yarn clean && vue-tsc --noEmit --composite false && vite build",
"types": "vue-tsc --noEmit --composite false",
"lint:js": "eslint --ext .js,.ts,.vue --ignore-path .gitignore src",
"lint:js:fix": "eslint --ext .js,.ts,.vue --ignore-path .gitignore src --fix",
"pretty": "yarn pretty:write && yarn pretty:check",
Expand Down Expand Up @@ -77,7 +77,7 @@
"vite-plugin-eslint": "^1.8",
"vue": "^3.2",
"vue-loader": "^17.0",
"vue-tsc": "^1.0"
"vue-tsc": "^1.4"
},
"peerDependencies": {
"vue": "^3.2"
Expand Down
4 changes: 2 additions & 2 deletions src/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ export function createWampV1Client(): InstallFunction {

const pluginOptions = { ...WampClientDefaultOptions, ...options };

const wampClient = new Client(pluginOptions.wsuri as string, new Logger(pluginOptions.debug));
this.wampClient = new Client(pluginOptions.wsuri as string, new Logger(pluginOptions.debug));

app.provide(key, wampClient);
app.provide(key, this.wampClient);
},
};

Expand Down
4 changes: 2 additions & 2 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Plugin, Ref } from 'vue';

export type InstallFunction = Plugin & { installed?: boolean };

export type OnOpenCallback = () => void;
export type OnCloseCallback = (code: number, reason: string | null) => void;
export type OnConnectCallback = () => void;
Expand Down Expand Up @@ -105,3 +103,5 @@ export enum MessageCode {
MSG_PUBLISH = 7,
MSG_EVENT = 8,
}

export type InstallFunction = Plugin & { installed?: boolean; wampClient?: IWampClient };

0 comments on commit 802dc8f

Please sign in to comment.