本文整理汇总了TypeScript中@angular-redux/store.NgRedux.provideStore方法的典型用法代码示例。如果您正苦于以下问题:TypeScript NgRedux.provideStore方法的具体用法?TypeScript NgRedux.provideStore怎么用?TypeScript NgRedux.provideStore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular-redux/store.NgRedux
的用法示例。
在下文中一共展示了NgRedux.provideStore方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(
ngRedux: NgRedux<IAppState>,
sendAnalytics: SendAnalytics) {
const store = createStore(
rootReducer,
compose(applyMiddleware(reduxLogger),
applyMiddleware(createEpicMiddleware(rootEpic)),
applyMiddleware(sendAnalytics.middleware)));
ngRedux.provideStore(store as Store<IAppState>);
}
示例2: constructor
constructor(private appRef: ApplicationRef,
private af: AngularFire,
private ngRedux: NgRedux<StoreState>,
private devTools: DevToolsExtension) {
AppModule.angularFire = af;
let enhancers = [];
if (devTools.isEnabled()) {
enhancers = [ ...enhancers, devTools.enhancer() ];
}
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store: any = createStore(
rootReducer,
initialState,
composeEnhancers(
applyMiddleware(),
//autoRehydrate()
)
);
//persistStore(store);
ngRedux.provideStore(store);
}
示例3: constructor
//wire up redux to Angular2 fw - "bridge between the two worlds"
constructor(ngRedux: NgRedux<IAppState>) { //inject instance of ngRedux
//use provideStore() fn to link to existing Redux Store instance (./store/store.js)
ngRedux.provideStore(store);
}
示例4: constructor
constructor(ngRedux: NgRedux<IAppState>) {
ngRedux.provideStore(store);
}