File tree Expand file tree Collapse file tree 1 file changed +16
-9
lines changed
packages/node_modules/overmind/src Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change 11import { ActionChain } from 'action-chain'
22import { EventEmitter } from 'betsy'
33import ProxyStateTree from 'proxy-state-tree'
4- import Derived from './derived'
5- import Devtools , { Message , safeValue } from './Devtools'
4+
65import ActionClass , {
7- IValueAction ,
8- INoValueAction ,
96 Compose ,
7+ INoValueAction ,
8+ IValueAction ,
109 createOperators ,
1110} from './Action'
12- import Reaction from './reaction'
11+ import Derived from './derived'
12+ import Devtools , { Message , safeValue } from './Devtools'
1313import {
1414 DynamicModule ,
15- SubType ,
16- Events ,
1715 EventType ,
16+ Events ,
1817 Options ,
18+ SubType ,
1919} from './internalTypes'
20+ import Reaction from './reaction'
2021
2122export { IValueAction , Compose , EventType }
2223
@@ -529,8 +530,14 @@ export default class App<
529530 }
530531 private processState ( state : { } ) {
531532 return Object . keys ( state ) . reduce ( ( aggr , key ) => {
532- aggr [ key ] =
533- typeof state [ key ] === 'function' ? new Derived ( state [ key ] ) : state [ key ]
533+ const value = state [ key ]
534+ if ( typeof value === 'object' ) {
535+ aggr [ key ] = this . processState ( value )
536+ } else if ( typeof value === 'function' ) {
537+ aggr [ key ] = new Derived ( value )
538+ } else {
539+ aggr [ key ] = value
540+ }
534541
535542 return aggr
536543 } , { } )
You can’t perform that action at this time.
0 commit comments