File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
packages/node_modules/overmind-angular/src Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,15 @@ export interface IConnect<Config extends Configuration> {
1313
1414let nextComponentId = 0
1515
16- export const createConnect = < A extends Overmind < any > > ( overmind : A ) => ( ) => {
16+ export const createConnect = < A extends Overmind < any > > ( overmind : A ) => (
17+ propsCallback ?: (
18+ overmind : {
19+ state : A [ 'state' ]
20+ actions : A [ 'actions' ]
21+ effects : A [ 'effects' ]
22+ }
23+ ) => object
24+ ) => {
1725 const componentId = nextComponentId ++
1826 let componentInstanceId = 0
1927
@@ -35,6 +43,16 @@ export const createConnect = <A extends Overmind<any>>(overmind: A) => () => {
3543 effects : overmind . effects ,
3644 addMutationListener : overmind . addMutationListener ,
3745 }
46+ if ( propsCallback ) {
47+ Object . assign (
48+ this ,
49+ propsCallback ( {
50+ state : this . __tree . state ,
51+ actions : overmind . actions ,
52+ effects : overmind . effects ,
53+ } )
54+ )
55+ }
3856 this . __shouldUpdatePaths = false
3957 this . __componentInstanceId = componentInstanceId ++
4058 this . __onUpdate = ( mutations , paths , flushId ) => {
You can’t perform that action at this time.
0 commit comments