@vnejs/module 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/modules/module.js CHANGED
@@ -8,7 +8,7 @@ export class Module {
8
8
  SETTINGS = VNE.SETTINGS;
9
9
  PARAMS = VNE.PARAMS;
10
10
 
11
- inject = ({ on, emit, emitOne, emitReal, state, shared, media, options } = {}) => {
11
+ inject = ({ on, emit, emitOne, emitReal, state, shared, media } = {}) => {
12
12
  // observer
13
13
  this.on = on;
14
14
  this.emit = emit;
@@ -21,15 +21,14 @@ export class Module {
21
21
 
22
22
  this.shared = shared;
23
23
  this.media = media;
24
- this.options = options;
25
24
  }; // abstract
26
25
  subscribe = () => {}; // implement
27
26
 
28
27
  init = async () => {}; // implement
29
28
 
30
29
  setState = (state = {}) => {
31
- this.globalState[this.name] = state;
32
- this.state = this.globalState[this.name];
30
+ Object.assign(this.globalState[this.name], state);
31
+ Object.assign(this.state, this.globalState[this.name]);
33
32
  }; // abstract
34
33
 
35
34
  updateState = (state = {}) => this.setState({ ...this.state, ...state });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/module",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {