File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ export default class Dispatcher {
33
33
: this . dispatch ( action ) ;
34
34
}
35
35
36
+ getAtom ( ) {
37
+ return this . atom ;
38
+ }
39
+
36
40
setAtom ( atom ) {
37
41
this . atom = atom ;
38
42
this . emitChange ( ) ;
Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ import { PropTypes } from 'react';
2
2
3
3
const dispatcherShape = PropTypes . shape ( {
4
4
subscribe : PropTypes . func . isRequired ,
5
- perform : PropTypes . func . isRequired
5
+ perform : PropTypes . func . isRequired ,
6
+ getAtom : PropTypes . func . isRequired
6
7
} ) ;
7
8
8
9
export default class Provider {
@@ -41,6 +42,10 @@ export default class Provider {
41
42
return this . props . dispatcher . perform ( actionCreator , ...args ) ;
42
43
}
43
44
45
+ getAtom ( ) {
46
+ return this . props . dispatcher . getAtom ( ) ;
47
+ }
48
+
44
49
render ( ) {
45
50
const { children } = this . props ;
46
51
return children ( ) ;
Original file line number Diff line number Diff line change @@ -8,5 +8,6 @@ export default function createDispatcher(...args) {
8
8
perform : ::dispatcher . perform ,
9
9
hydrate : ::dispatcher . hydrate ,
10
10
dehydrate : ::dispatcher . dehydrate ,
11
+ getAtom : ::dispatcher . getAtom
11
12
} ;
12
13
}
You can’t perform that action at this time.
0 commit comments