本文整理匯總了TypeScript中@angular-redux/store.NgRedux.configureStore方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript NgRedux.configureStore方法的具體用法?TypeScript NgRedux.configureStore怎麽用?TypeScript NgRedux.configureStore使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@angular-redux/store.NgRedux
的用法示例。
在下文中一共展示了NgRedux.configureStore方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: constructor
constructor(private ngRedux: NgRedux<IAppState>,
private router: Router,
private userEpics: UserEpics,
private profileEpics: ProfileEpics,
private quotesEpics: QuotesEpics,
private usersEpics: UsersEpics) {
const epics = [
this.userEpics.signin,
this.userEpics.signup,
this.userEpics.resetPassword,
this.userEpics.changePassword,
this.profileEpics.fetchUser,
this.profileEpics.updateUser,
this.quotesEpics.fetchQuotes,
this.quotesEpics.saveQuote,
this.quotesEpics.updateQuoteModal,
this.quotesEpics.updateQuote,
this.quotesEpics.removeQuote,
this.quotesEpics.recommendQuote,
this.quotesEpics.unrecommendQuote,
this.usersEpics.fetchUsers,
this.usersEpics.followUser,
this.usersEpics.unfollowUser,
];
const epicsMiddlewares = epics.reduce((acc: any[], epic: any) => acc.concat(createEpicMiddleware(epic)), []);
ngRedux.configureStore(rootReducer, {}, [...middlewares, ...epicsMiddlewares], enhancers);
}
示例2: constructor
constructor(
private ngRedux: NgRedux<IAppState>,
private devTool: DevToolsExtension,
private rootEpic: RootEpic,
private router: Router,
) {
const middleware = [
createEpicMiddleware(this.rootEpic.combineAll()),
createLogger(),
];
const reducer = compose(
mergePersistedState()
)(rootReducer);
const storage = compose(
filter('auth')
)(adapter(window.localStorage));
const enhancers = [
persistState(storage, 'fyibn/store'),
];
if (devTool.isEnabled()) {
enhancers.push(devTool.enhancer());
}
this.ngRedux.configureStore(
reducer,
{} as IAppState,
middleware,
enhancers,
);
}
示例3: constructor
constructor(ngRedux: NgRedux<IAppState>, devTools: DevToolsExtension) {
ngRedux.configureStore(
rootReducer,
INITIAL_STATE,
[],
devTools.isEnabled() ? [ devTools.enhancer() ] : []
);
}
示例4: constructor
constructor(ngRedux: NgRedux<IAppState>) {
// Tell @angular-redux/store about our rootReducer and our initial state.
// It will use this to create a redux store for us and wire up all the
// events.
ngRedux.configureStore(
rootReducer,
INITIAL_STATE);
}
示例5: constructor
constructor(
private ngRedux: NgRedux<IAppState>,
private devTool: DevToolsExtension) {
// configure the store here, this is where the enhancers are set
this.ngRedux.configureStore(rootReducer, {},
isDevMode() ? [createLogger({ collapsed: true })] : [],
isDevMode() && devTool.isEnabled() ? [...enhancers, devTool.enhancer()] : [...enhancers]);
}
示例6: beforeEach
beforeEach(inject([NgRedux], (store: NgRedux<AppState>) => {
store.configureStore(rootReducer, {
...APP_INITIAL_STATE,
inventur: {
...INVENTUR_INITIAL_STATE,
inventurId: testfall.inventurId,
eroeffnungsbilanz: testfall.eroeffnungsbilanz
}
})
}))
示例7: constructor
constructor(
private ngRedux: NgRedux<IAppState>,
private devTool: DevToolsExtension) {
this.ngRedux.configureStore(
rootReducer,
{},
[ createLogger() ],
[ ...enhancers, devTool.isEnabled() ? devTool.enhancer() : f => f]);
}
示例8: constructor
constructor(private ngRedux:NgRedux<any>) {
this.ngRedux.configureStore(
rootReducer, {
apiPanel:configJcropInitialState('apiPanel'),
defaultPanel:configJcropInitialState('defaultPanel'),
showSelectionPanel:configJcropInitialState('showSelectionPanel'),
previewPanel:configJcropInitialState('previewPanel'),
animationsPanel:configJcropInitialState('animationsPanel'),
stylingPanel:configJcropInitialState('stylingPanel'),
}
);
}
示例9: constructor
constructor(
public store: NgRedux<AppStateModel>,
ngReduxRouter: NgReduxRouter
) {
store.configureStore(rootReducer, initialState);
if (ngReduxRouter) {
ngReduxRouter.initialize();
}
provideReduxForms(store);
}
示例10: constructor
constructor(
private ngRedux: NgRedux<IAppState>,
private devTools: DevToolsExtension
) {
const tools = devTools.isEnabled() ?
[ ...enhancers, devTools.enhancer() ] : enhancers;
ngRedux.configureStore(
rootReducer,
{},
middleware,
tools
);
}