import { Injector , NgZone } from '@angular/core' ; import { Store } from '@ngxs/store' ; class NgxsDispatchPluginModuleNotImported extends Error { message = 'NgxsDispatchPluginModule is not imported' ; } let _injector = null ; export function setInjector ( injector ) { _injector = injector ; } export function getStore ( ) { if ( _injector === null ) { throw new NgxsDispatchPluginModuleNotImported ( ) ; } else { return _injector . get ( Store ) ; } } export function getNgZone ( ) { if ( _injector === null ) { throw new NgxsDispatchPluginModuleNotImported ( ) ; } else { return _injector . get ( NgZone ) ; } }