Skip to content

Commit

Permalink
feat: publish v0.1.1 version
Browse files Browse the repository at this point in the history
  • Loading branch information
imtaotao committed Nov 20, 2019
1 parent e15d23b commit c33821c
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 76 deletions.
72 changes: 36 additions & 36 deletions demo/pages/module/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,40 @@ Page({
storeConfig: {
travelLimit: 5,
defineReducer (store) {
store.add('one', {
partialState: {
name: 'chen',
},
setter: (state, payload) => ({ name: payload })
})
store.add('two', {
namespace: 'a',
partialState: {
age: 0,
},
setter: (state, payload) => ({ age: payload })
})
store.add('three', {
namespace: 'a.b',
partialState: {
sex: 'man',
},
setter: (state, payload) => ({ sex: payload })
})

// store.add('action', {
// store.add('one', {
// partialState: {
// a: createModule({}),
// }
// name: 'chen',
// },
// setter: (state, payload) => ({ name: payload })
// })
// store.add('two', {
// namespace: 'b',
// partialState: {},
// namespace: 'a',
// partialState: {
// age: 0,
// },
// setter: (state, payload) => ({ age: payload })
// })
// store.add('three', {
// namespace: 'a.a',
// partialState: { a: 1 },
// namespace: 'a.b',
// partialState: {
// sex: 'man',
// },
// setter: (state, payload) => ({ sex: payload })
// })

store.add('action', {
partialState: {
a: {},
}
})
// store.add('two', {
// namespace: 'b',
// partialState: {},
// })
store.add('three', {
namespace: 'a.b',
partialState: { a: 1 },
})
// store.add('four', {
// namespace: 'a.a',
// partialState: { b: 2 },
Expand Down Expand Up @@ -114,14 +114,14 @@ Page({
// useState: () => (['taoo.tao', {
// index: state => state.index,
// }]),
travelLimit: 5,
useState () {
return ['a.b', {
sex: s => s.sex,
name: (s, r) => r.name,
age: (s, r) => r.a.age,
}]
},
// travelLimit: 5,
// useState () {
// return ['a.b', {
// sex: s => s.sex,
// name: (s, r) => r.name,
// age: (s, r) => r.a.age,
// }]
// },
},

check (sex, name, age) {
Expand Down
8 changes: 2 additions & 6 deletions demo/store/mpstore.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,6 @@ function createModuleByNamespace(namespace, partialModule, rootModule, stringify
var key = segments[i];
var isLastIndex = i === len - 1;

if (i > 0) {
assert(isModule(parentModule), 'the child modules must be in the parent module.\n\n' + " the parent module namespace is [".concat(segments[i - 1], "]\n\n") + " the child module namespace is [".concat(key, "]").concat(remaingMsg));
}

if (key in parentModule) {
assert(isModule(parentModule[key]), 'you can\'t create child moudle, ' + "because namespace [".concat(key, "] already exists in [").concat(segments[i - 1] || 'root', "] module, ") + "but [".concat(key, "] not a module.").concat(remaingMsg));
childModule = isLastIndex ? mergeModule(parentModule[key], partialModule, key, createMsg) : Object.assign({}, parentModule[key]);
Expand Down Expand Up @@ -819,7 +815,7 @@ function () {
this.depComponents = [];
this.GLOBALWORD = 'global';
this.isDispatching = false;
this.version = '0.1.0';
this.version = '0.1.1';
this.state = Object.freeze(createModule({}));
this.middleware = new Middleware(this);
}
Expand Down Expand Up @@ -1072,7 +1068,7 @@ function () {
return Store;
}();

var version = '0.1.0';
var version = '0.1.1';
var nativePage = Page;
var nativeComponent = Component;

Expand Down
8 changes: 2 additions & 6 deletions dist/mpstore.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,6 @@ function createModuleByNamespace(namespace, partialModule, rootModule, stringify
var key = segments[i];
var isLastIndex = i === len - 1;

if (i > 0) {
assert(isModule(parentModule), 'the child modules must be in the parent module.\n\n' + " the parent module namespace is [".concat(segments[i - 1], "]\n\n") + " the child module namespace is [".concat(key, "]").concat(remaingMsg));
}

if (key in parentModule) {
assert(isModule(parentModule[key]), 'you can\'t create child moudle, ' + "because namespace [".concat(key, "] already exists in [").concat(segments[i - 1] || 'root', "] module, ") + "but [".concat(key, "] not a module.").concat(remaingMsg));
childModule = isLastIndex ? mergeModule(parentModule[key], partialModule, key, createMsg) : Object.assign({}, parentModule[key]);
Expand Down Expand Up @@ -823,7 +819,7 @@ function () {
this.depComponents = [];
this.GLOBALWORD = 'global';
this.isDispatching = false;
this.version = '0.1.0';
this.version = '0.1.1';
this.state = Object.freeze(createModule({}));
this.middleware = new Middleware(this);
}
Expand Down Expand Up @@ -1076,7 +1072,7 @@ function () {
return Store;
}();

var version = '0.1.0';
var version = '0.1.1';
var nativePage = Page;
var nativeComponent = Component;

Expand Down
12 changes: 2 additions & 10 deletions dist/mpstore.es6m.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,6 @@ function createModuleByNamespace (namespace, partialModule, rootModule, stringif
let childModule;
const key = segments[i];
const isLastIndex = i === len - 1;
if (i > 0) {
assert(
isModule(parentModule),
'the child modules must be in the parent module.\n\n' +
` the parent module namespace is [${segments[i - 1]}]\n\n` +
` the child module namespace is [${key}]${remaingMsg}`,
);
}
if (key in parentModule) {
assert(
isModule(parentModule[key]),
Expand Down Expand Up @@ -659,7 +651,7 @@ class Store {
this.depComponents = [];
this.GLOBALWORD = 'global';
this.isDispatching = false;
this.version = '0.1.0';
this.version = '0.1.1';
this.state = Object.freeze(createModule({}));
this.middleware = new Middleware(this);
}
Expand Down Expand Up @@ -893,7 +885,7 @@ class Store {
}
}

const version = '0.1.0';
const version = '0.1.1';
const nativePage = Page;
const nativeComponent = Component;
function expandConfig (config, expandMethods, isPage) {
Expand Down
8 changes: 2 additions & 6 deletions dist/mpstore.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,6 @@ function createModuleByNamespace(namespace, partialModule, rootModule, stringify
var key = segments[i];
var isLastIndex = i === len - 1;

if (i > 0) {
assert(isModule(parentModule), 'the child modules must be in the parent module.\n\n' + " the parent module namespace is [".concat(segments[i - 1], "]\n\n") + " the child module namespace is [".concat(key, "]").concat(remaingMsg));
}

if (key in parentModule) {
assert(isModule(parentModule[key]), 'you can\'t create child moudle, ' + "because namespace [".concat(key, "] already exists in [").concat(segments[i - 1] || 'root', "] module, ") + "but [".concat(key, "] not a module.").concat(remaingMsg));
childModule = isLastIndex ? mergeModule(parentModule[key], partialModule, key, createMsg) : Object.assign({}, parentModule[key]);
Expand Down Expand Up @@ -819,7 +815,7 @@ function () {
this.depComponents = [];
this.GLOBALWORD = 'global';
this.isDispatching = false;
this.version = '0.1.0';
this.version = '0.1.1';
this.state = Object.freeze(createModule({}));
this.middleware = new Middleware(this);
}
Expand Down Expand Up @@ -1072,7 +1068,7 @@ function () {
return Store;
}();

var version = '0.1.0';
var version = '0.1.1';
var nativePage = Page;
var nativeComponent = Component;

Expand Down
Loading

0 comments on commit c33821c

Please sign in to comment.