Skip to content

Commit

Permalink
Add support for Vue CLI 3
Browse files Browse the repository at this point in the history
index.js - add return statement
package.json - bump version
README.md - add support flag

Add support for Vue CLI 3
index.js - add return statement
package.json - bump version
README.md - add support flag
  • Loading branch information
creynir committed Apr 29, 2019
1 parent ed44cfa commit 8f92e95
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![Coverage Status](https://coveralls.io/repos/github/creynir/vuex-socketio/badge.svg?branch=master)](https://coveralls.io/github/creynir/vuex-socketio?branch=master)
[![NPM version](https://img.shields.io/npm/v/vuex-socketio.svg)](https://www.npmjs.com/package/vuex-socketio)
![Vuex v3 compatible](https://img.shields.io/badge/Vuex%20v3-compatible-green.svg)
![Vue CLI 3 compatible](https://img.shields.io/badge/Vue%20CLI%203-compatible-green.svg)
<a href="https://www.npmjs.com/package/vuex-socketio"><img src="https://img.shields.io/npm/dt/vuex-socketio.svg" alt="Downloads"></a>

> Vuex plugin for Socket.io-client.
Expand Down Expand Up @@ -173,7 +174,8 @@ export default new Vuex.Store({
})
```
### Notes
**Plugin doesn't support dynamic registred store modules.**<br />
**No support for dynamic registred store modules.**<br />
**Plugin emits first to the socket channel and then it calls related Vuex store action.**<br />
### Example
[demo](./demo)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vuex-socketio",
"description": "A Socket.io-client Plugin for Vuex",
"version": "0.3.1",
"version": "0.3.2",
"main": "dist/build.js",
"author": "Mikhail Rogov",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function bindActionToEmitter (actionName, funcArr, options) {
funcArr.forEach((func, index) => {
options.store._actions[actionName][index] = (payload) => {
options.socket.emit(options.converter(channelName), payload);
func.call(options.store, payload);
return func.call(options.store, payload);
};
});
}
Expand All @@ -113,8 +113,8 @@ function bindDefaultActionToSocket (actionName, funcArr, functionName, options)
if (checkIfSocketFnExists(socketFnName, options.socket)) {
funcArr.forEach((func, index) => {
options.store._actions[actionName][index] = (payload) => {
func.call(options.store, payload);
options.socket[socketFnName]();
return func.call(options.store, payload);
};
});
}
Expand Down

0 comments on commit 8f92e95

Please sign in to comment.