File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/node_modules/overmind/src Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ function isObject(value) {
66
77let hasWarnedConstructor = false
88let currentEffectId = 0
9-
9+ const ORIGIN_TARGET = Symbol ( 'ORIGIN_TARGET' )
1010export function proxifyEffects < Effects > (
1111 effects : Effects ,
1212 cb : ( effect ) => void ,
@@ -22,7 +22,7 @@ export function proxifyEffects<Effects>(
2222 const name = path . split ( '.' )
2323 const method = name . pop ( )
2424 return cb ( {
25- func : target . bind ( thisArg ) ,
25+ func : target . bind ( thisArg [ ORIGIN_TARGET ] ) ,
2626 effectId,
2727 name : name . join ( '.' ) ,
2828 method,
@@ -40,6 +40,10 @@ export function proxifyEffects<Effects>(
4040 return new Target ( ...args )
4141 } ,
4242 get ( target , prop ) {
43+ if ( prop === ORIGIN_TARGET ) {
44+ return target
45+ }
46+
4347 return proxifyEffects ( target [ prop ] , cb , path ? path + '.' + prop . toString ( ) : prop . toString ( ) )
4448 }
4549 } )
You can’t perform that action at this time.
0 commit comments