File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 1
1
declare interface StateHandler {
2
2
( appState : string , newAppState : string ) : void
3
- }
4
- declare function appState ( stateHandler : StateHandler ) : void
3
+ }
4
+ declare function appState ( stateHandler : StateHandler ) : appState . AppStateInstance
5
5
6
6
declare namespace appState {
7
+ interface AppStateInstance { }
7
8
// Application is under initialization.
8
9
function init ( ) : void
9
10
// Application is running.
Original file line number Diff line number Diff line change 1
1
import * as AppState from '.'
2
+ import { AppStateInstance } from '.'
2
3
3
4
// init application state handler with logging
4
- AppState (
5
+ export const appStateInstance : AppStateInstance = AppState (
5
6
( appState : string , newAppState : string ) : void => {
6
7
if ( AppState . isError ( ) || AppState . isFatal ( ) ) {
7
- console . error ( { details : ` ${ appState } to ${ newAppState } ` } , 'appstate' )
8
+ console . error ( `appstate ${ appState } to ${ newAppState } `)
8
9
} else {
9
- console . warn ( { details : ` ${ appState } to ${ newAppState } ` } , 'appstate' )
10
+ console . warn ( `appstate ${ appState } to ${ newAppState } `)
10
11
}
11
12
} ,
12
13
)
You can’t perform that action at this time.
0 commit comments