diff --git a/packages/store/src/state-factory.ts b/packages/store/src/state-factory.ts index 1cda38a0e..017db1ec5 100644 --- a/packages/store/src/state-factory.ts +++ b/packages/store/src/state-factory.ts @@ -43,6 +43,14 @@ export class StateFactory { private _dispatcher: InternalDispatcher ) {} + private get rootStateOperations(): InternalStateOperations { + return { + getState: () => this._stateStream.getValue(), + setState: newState => this._stateStream.next(newState), + dispatch: actions => this._dispatcher.dispatch(actions) + }; + } + /** * Add a new state to the global defs. */ @@ -136,19 +144,10 @@ export class StateFactory { ); }) ) - .subscribe(ctx => { - this._actionResults.next(ctx); - }); + .subscribe(ctx => this._actionResults.next(ctx)); this._connected = true; } - private get rootStateOperations(): InternalStateOperations { - return { - getState: () => this._stateStream.getValue(), - setState: newState => this._stateStream.next(newState), - dispatch: actions => this._dispatcher.dispatch(actions) - }; - } /** * Invoke the init function on the states. */