天天看点

SAP Spartacus StoreFeatureModule

SAP Spartacus StoreFeatureModule
SAP Spartacus StoreFeatureModule
SAP Spartacus StoreFeatureModule
SAP Spartacus StoreFeatureModule
SAP Spartacus StoreFeatureModule
SAP Spartacus StoreFeatureModule
SAP Spartacus StoreFeatureModule
SAP Spartacus StoreFeatureModule
SAP Spartacus StoreFeatureModule
SAP Spartacus StoreFeatureModule
SAP Spartacus StoreFeatureModule
SAP Spartacus StoreFeatureModule

class StoreModule {

   /**

    * @param {?} reducers

    * @param {?=} config

    * @return {?}

    */

   static forRoot(reducers, config = {}) {

       return {

           ngModule: StoreRootModule,

           providers: [

               {

                   provide: _ROOT_STORE_GUARD,

                   useFactory: _provideForRootGuard,

                   deps: [[Store, new Optional(), new SkipSelf()]],

               },

               { provide: _INITIAL_STATE, useValue: config.initialState },

                   provide: INITIAL_STATE,

                   useFactory: _initialStateFactory,

                   deps: [_INITIAL_STATE],

               { provide: _INITIAL_REDUCERS, useValue: reducers },

                   provide: _STORE_REDUCERS,

                   useExisting: reducers instanceof InjectionToken ? reducers : _INITIAL_REDUCERS,

                   provide: INITIAL_REDUCERS,

                   deps: [Injector, _INITIAL_REDUCERS, [new Inject(_STORE_REDUCERS)]],

                   useFactory: _createStoreReducers,

                   provide: USER_PROVIDED_META_REDUCERS,

                   useValue: config.metaReducers ? config.metaReducers : [],

                   provide: _RESOLVED_META_REDUCERS,

                   deps: [META_REDUCERS, USER_PROVIDED_META_REDUCERS],

                   useFactory: _concatMetaReducers,

                   provide: _REDUCER_FACTORY,

                   useValue: config.reducerFactory

                       ? config.reducerFactory

                       : combineReducers,

                   provide: REDUCER_FACTORY,

                   deps: [_REDUCER_FACTORY, _RESOLVED_META_REDUCERS],

                   useFactory: createReducerFactory,

               ACTIONS_SUBJECT_PROVIDERS,

               REDUCER_MANAGER_PROVIDERS,

               SCANNED_ACTIONS_SUBJECT_PROVIDERS,

               STATE_PROVIDERS,

               STORE_PROVIDERS,

               provideRuntimeChecks(config.runtimeChecks),

           ],

       };

   }

SAP Spartacus StoreFeatureModule

继续阅读