File tree Expand file tree Collapse file tree 5 files changed +26
-18
lines changed
packages/node_modules/overmind/src Expand file tree Collapse file tree 5 files changed +26
-18
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ name : Report BUG
3+ about : If you want support we recommend rather joining the Discord chat at https://discord.gg/CdpmRhQ.
4+ title : " [BUG]"
5+ labels : bug
6+ assignees : ' christianalfoni'
7+
8+ ---
Original file line number Diff line number Diff line change @@ -318,7 +318,7 @@ export class Overmind<ThisConfig extends IConfiguration>
318318 nextTick && clearTimeout ( nextTick )
319319 nextTick = setTimeout ( flushTree , 0 )
320320 } )
321- } else if ( mode . mode === MODE_DEFAULT ) {
321+ } else if ( mode . mode === MODE_DEFAULT || mode . mode === MODE_TEST ) {
322322 eventHub . on ( EventType . OPERATOR_ASYNC , ( execution ) => {
323323 const flushData = execution . flush ( true )
324324 if ( this . devtools && flushData . mutations . length ) {
@@ -396,6 +396,7 @@ export class Overmind<ThisConfig extends IConfiguration>
396396 [ EXECUTION ] : true ,
397397 parentExecution,
398398 namespacePath,
399+ actionName : name ,
399400 getMutationTree : ( ) => {
400401 return this . proxyStateTree . getMutationTree ( )
401402 } ,
Original file line number Diff line number Diff line change @@ -151,8 +151,8 @@ export interface Events {
151151
152152// ============= PRIVATE TYPES FOR APP
153153
154- export type ResolveState < State extends IState | null > = State extends undefined
155- ? { }
154+ export type ResolveState < State extends IState | null | undefined > = State extends undefined
155+ ? State
156156 : {
157157 [ P in keyof State ] : State [ P ] extends ( parent : ResolveState < IState > , root : any ) => any
158158 ? ReturnType < State [ P ] >
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export type Statemachine<States extends string> = {
1111 current : States
1212 reset : ( ) => void
1313} & {
14- [ State in States ] : < T > ( entry ?: ( ) => T , exit ?: ( ) => void ) => T
14+ [ State in States ] : < T extends ( ) => any > ( entry ?: T , exit ?: ( ) => void ) => T extends ( ) => infer U ? U : void
1515}
1616
1717const CURRENT_EXIT = Symbol ( 'CURRENT_EXIT' )
@@ -27,9 +27,9 @@ class StateMachine<States extends string> {
2727 if ( definition . states [ this . current ] . includes ( key as any ) ) {
2828 if ( this [ CURRENT_EXIT ] ) this [ CURRENT_EXIT ] ( )
2929 this [ VALUE ] [ CURRENT_EXIT ] = exit
30- this . current = key as any
3130 const tree = ( this [ PROXY_TREE ] . master . mutationTree || this [ PROXY_TREE ] )
3231 tree . enableMutations ( )
32+ this . current = key as any
3333 const result = entry && entry ( )
3434 tree . blockMutations ( )
3535
Original file line number Diff line number Diff line change @@ -13,19 +13,18 @@ export type IConfiguration = {
1313 actions ?: { }
1414}
1515
16- export type IState =
17- | {
18- [ key : string ] :
19- | IState
20- | string
21- | IDerive < any , any , any >
22- | number
23- | boolean
24- | object
25- | null
26- | undefined
27- }
28- | undefined
16+ export type IState = {
17+ [ key : string ] :
18+ | IState
19+ | string
20+ | IDerive < any , any , any >
21+ | number
22+ | boolean
23+ | object
24+ | null
25+ | undefined
26+ }
27+
2928
3029export interface IConfig < ThisConfig extends IConfiguration > {
3130 state : ThisConfig [ 'state' ] & { }
You can’t perform that action at this time.
0 commit comments