1- import { Component } from './state '
2- import { Derive } from '../app '
1+ import { Derive } from 'overmind '
2+ import { Component , App , Flush , Action } from './state '
33
4- export const currentApp : Derive = ( state ) => state . apps [ state . currentPort ]
4+ export const currentApp : Derive < App > = ( state ) => state . apps [ state . currentPort ]
55
6- export const componentsMounted : Derive = ( state ) =>
6+ export const componentsMounted : Derive < Component [ ] > = ( state ) =>
77 Object . keys ( state . currentApp . components ) . reduce (
88 ( aggr , key ) => {
99 if ( state . currentApp . components [ key ] . isMounted ) {
@@ -15,19 +15,19 @@ export const componentsMounted: Derive = (state) =>
1515 [ ] as Component [ ]
1616 )
1717
18- export const componentsUpdateCount : Derive = ( state ) =>
18+ export const componentsUpdateCount : Derive < number > = ( state ) =>
1919 state . componentsMounted . reduce (
2020 ( aggr , component ) => aggr + component . updateCount ,
2121 0
2222 )
2323
24- export const componentsStatePathCount : Derive = ( state ) =>
24+ export const componentsStatePathCount : Derive < number > = ( state ) =>
2525 state . componentsMounted . reduce (
2626 ( aggr , component ) => aggr + component . paths . length ,
2727 0
2828 )
2929
30- export const flushes : Derive = ( state ) =>
30+ export const flushes : Derive < Flush [ ] > = ( state ) =>
3131 Object . keys ( state . currentApp . flushes )
3232 . sort (
3333 ( idA , idB ) =>
@@ -36,10 +36,10 @@ export const flushes: Derive = (state) =>
3636 )
3737 . map ( ( id ) => state . currentApp . flushes [ id ] )
3838
39- export const flushesMutationsCount : Derive = ( state ) =>
39+ export const flushesMutationsCount : Derive < number > = ( state ) =>
4040 state . flushes . reduce ( ( aggr , flush ) => aggr + flush . mutations . length , 0 )
4141
42- export const flushesStatePathCount : Derive = ( state ) =>
42+ export const flushesStatePathCount : Derive < number > = ( state ) =>
4343 state . flushes . reduce ( ( aggr , flush ) => {
4444 return flush . mutations . reduce (
4545 ( aggr , mutation ) =>
@@ -48,5 +48,5 @@ export const flushesStatePathCount: Derive = (state) =>
4848 )
4949 } , [ ] ) . length
5050
51- export const currentAction : Derive = ( state ) =>
51+ export const currentAction : Derive < Action > = ( state ) =>
5252 state . currentApp . actions [ state . currentApp . currentActionId ]
0 commit comments