piral-redux 0.15.0-alpha.3933 → 0.15.0-alpha.4027
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-redux",
|
|
3
|
-
"version": "0.15.0-alpha.
|
|
3
|
+
"version": "0.15.0-alpha.4027",
|
|
4
4
|
"description": "Plugin for the integration of Redux in a Piral instance.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral",
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
"@types/react": "^17.0.0",
|
|
53
53
|
"@types/react-redux": "^5.0.19",
|
|
54
54
|
"@types/redux": "^3.6.0",
|
|
55
|
-
"piral-core": "0.15.0-alpha.
|
|
55
|
+
"piral-core": "0.15.0-alpha.4027",
|
|
56
56
|
"react": "^17.0.1"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"piral-core": "0.14.x",
|
|
60
60
|
"react": ">=16.8.0"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "324ff88850415188d0015efc509346705224a4dc"
|
|
63
63
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Atom, swap } from '@dbeining/react-atom';
|
|
1
|
+
import { Atom, swap, deref } from '@dbeining/react-atom';
|
|
2
2
|
import { createReduxApi } from './create';
|
|
3
3
|
|
|
4
4
|
function createMockContainer() {
|
|
@@ -8,11 +8,11 @@ function createMockContainer() {
|
|
|
8
8
|
on: jest.fn(),
|
|
9
9
|
off: jest.fn(),
|
|
10
10
|
emit: jest.fn(),
|
|
11
|
-
includeProvider() {},
|
|
12
|
-
defineActions() {},
|
|
11
|
+
includeProvider() { },
|
|
12
|
+
defineActions() { },
|
|
13
13
|
state,
|
|
14
14
|
readState(read) {
|
|
15
|
-
return read(state);
|
|
15
|
+
return read(deref(state));
|
|
16
16
|
},
|
|
17
17
|
dispatch(update) {
|
|
18
18
|
swap(state, update);
|
|
@@ -22,6 +22,9 @@ function createMockContainer() {
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
const MyComponent: React.FC = () => <div>Component</div>;
|
|
26
|
+
MyComponent.displayName = 'MyComponent';
|
|
27
|
+
|
|
25
28
|
describe('Piral-Redux create module', () => {
|
|
26
29
|
it('creates a new substate', () => {
|
|
27
30
|
const { context } = createMockContainer();
|
|
@@ -29,5 +32,6 @@ describe('Piral-Redux create module', () => {
|
|
|
29
32
|
const api = apiCreator(undefined, {
|
|
30
33
|
name: 'test',
|
|
31
34
|
});
|
|
35
|
+
api.createReduxStore(() => { })(MyComponent);
|
|
32
36
|
});
|
|
33
37
|
});
|