reactant-model 0.14.0 → 0.17.0
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/package.json +2 -2
- package/test/index.test.ts +19 -20
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reactant-model",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "A model lib for Reactant",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"unpkg": "dist/index.umd.js",
|
|
@@ -18,6 +18,6 @@
|
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"immer": "^9.0.5",
|
|
21
|
-
"reactant-module": "^0.
|
|
21
|
+
"reactant-module": "^0.17.0"
|
|
22
22
|
}
|
|
23
23
|
}
|
package/test/index.test.ts
CHANGED
|
@@ -50,15 +50,15 @@ test('base model with `useValue`', () => {
|
|
|
50
50
|
},
|
|
51
51
|
});
|
|
52
52
|
const foo = container.get(Foo);
|
|
53
|
-
const store = createStore(
|
|
53
|
+
const store = createStore({
|
|
54
54
|
modules,
|
|
55
55
|
container,
|
|
56
56
|
ServiceIdentifiers,
|
|
57
|
-
new Set(),
|
|
58
|
-
(...args: any[]) => {
|
|
57
|
+
loadedModules: new Set(),
|
|
58
|
+
load: (...args: any[]) => {
|
|
59
59
|
//
|
|
60
60
|
},
|
|
61
|
-
{
|
|
61
|
+
pluginHooks: {
|
|
62
62
|
middleware: [],
|
|
63
63
|
beforeCombineRootReducers: [],
|
|
64
64
|
afterCombineRootReducers: [],
|
|
@@ -66,8 +66,8 @@ test('base model with `useValue`', () => {
|
|
|
66
66
|
preloadedStateHandler: [],
|
|
67
67
|
afterCreateStore: [],
|
|
68
68
|
provider: [],
|
|
69
|
-
}
|
|
70
|
-
);
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
71
|
expect(Object.values(store.getState())).toEqual([{ todoList: [] }]);
|
|
72
72
|
foo.add('test');
|
|
73
73
|
expect(Object.values(store.getState())).toEqual([{ todoList: ['test'] }]);
|
|
@@ -122,13 +122,13 @@ test('base model with `useFactory`', () => {
|
|
|
122
122
|
},
|
|
123
123
|
});
|
|
124
124
|
const foo = container.get(Foo);
|
|
125
|
-
const store = createStore(
|
|
125
|
+
const store = createStore({
|
|
126
126
|
modules,
|
|
127
127
|
container,
|
|
128
128
|
ServiceIdentifiers,
|
|
129
|
-
new Set(),
|
|
130
|
-
(...args: any[]) => {},
|
|
131
|
-
{
|
|
129
|
+
loadedModules: new Set(),
|
|
130
|
+
load: (...args: any[]) => {},
|
|
131
|
+
pluginHooks: {
|
|
132
132
|
middleware: [],
|
|
133
133
|
beforeCombineRootReducers: [],
|
|
134
134
|
afterCombineRootReducers: [],
|
|
@@ -136,8 +136,8 @@ test('base model with `useFactory`', () => {
|
|
|
136
136
|
preloadedStateHandler: [],
|
|
137
137
|
afterCreateStore: [],
|
|
138
138
|
provider: [],
|
|
139
|
-
}
|
|
140
|
-
);
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
141
|
expect(store.getState()).toEqual({
|
|
142
142
|
todos: { todoList: ['bar'] },
|
|
143
143
|
});
|
|
@@ -194,15 +194,15 @@ test('base model with `useValue` and `enablePatches`', () => {
|
|
|
194
194
|
},
|
|
195
195
|
});
|
|
196
196
|
const foo = container.get(Foo);
|
|
197
|
-
const store = createStore(
|
|
197
|
+
const store = createStore({
|
|
198
198
|
modules,
|
|
199
199
|
container,
|
|
200
200
|
ServiceIdentifiers,
|
|
201
|
-
new Set(),
|
|
202
|
-
(...args: any[]) => {
|
|
201
|
+
loadedModules: new Set(),
|
|
202
|
+
load: (...args: any[]) => {
|
|
203
203
|
//
|
|
204
204
|
},
|
|
205
|
-
{
|
|
205
|
+
pluginHooks: {
|
|
206
206
|
middleware: [],
|
|
207
207
|
beforeCombineRootReducers: [],
|
|
208
208
|
afterCombineRootReducers: [],
|
|
@@ -211,11 +211,10 @@ test('base model with `useValue` and `enablePatches`', () => {
|
|
|
211
211
|
afterCreateStore: [],
|
|
212
212
|
provider: [],
|
|
213
213
|
},
|
|
214
|
-
|
|
215
|
-
{
|
|
214
|
+
devOptions: {
|
|
216
215
|
enablePatches: true,
|
|
217
|
-
}
|
|
218
|
-
);
|
|
216
|
+
},
|
|
217
|
+
});
|
|
219
218
|
const originalTodoState = foo.todo[stateKey]!;
|
|
220
219
|
expect(Object.values(store.getState())).toEqual([{ todoList: [] }]);
|
|
221
220
|
expect(actionFn.mock.calls.length).toBe(0);
|