本文整理汇总了TypeScript中angular2-redux.createAppStoreFactoryWithOptions函数的典型用法代码示例。如果您正苦于以下问题:TypeScript createAppStoreFactoryWithOptions函数的具体用法?TypeScript createAppStoreFactoryWithOptions怎么用?TypeScript createAppStoreFactoryWithOptions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了createAppStoreFactoryWithOptions函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: createAppStoreFactoryWithOptions
import "reflect-metadata";
import {bootstrap} from "@angular/platform-browser-dynamic";
import {provide} from "@angular/core";
import {AppComponent} from "./app-component";
import {HTTP_PROVIDERS} from "@angular/http";
import {LocationStrategy, HashLocationStrategy} from '@angular/common';
import {ROUTER_PROVIDERS} from '@angular/router-deprecated';
import "angular2-materialize";
import {AppStore,createAppStoreFactoryWithOptions} from "angular2-redux";
import users from "./reducers/users-reducer";
const appStoreFactory = createAppStoreFactoryWithOptions({reducers:users,debug:true});
bootstrap(AppComponent, [
provide(AppStore, {useFactory: appStoreFactory}),
ROUTER_PROVIDERS, provide(LocationStrategy, {useClass: HashLocationStrategy}),
HTTP_PROVIDERS
]);
/* tslint:disable */
// polyfill for Object.assign (not part of TS yet)
// https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
if (!Object.assign) {
Object.defineProperty(Object, "assign", {
enumerable: false,
configurable: true,
writable: true,
示例2: createAppStoreFactoryWithOptions
import { createAppStoreFactoryWithOptions } from 'angular2-redux';
import explore from './reducers/explore-page-reducer';
import home from './reducers/home-page-reducer';
import app from './reducers/app-reducer';
const AppStoreFactory = createAppStoreFactoryWithOptions({
reducers: {
app,
explore,
home
}
});
export default AppStoreFactory;
示例3: createAppStoreFactoryWithOptions
import {bootstrap} from "angular2/platform/browser";
import {provide} from "angular2/core";
import {HTTP_PROVIDERS} from "angular2/http";
import {AppComponent} from "./app";
import {AppStore,createAppStoreFactoryWithOptions} from "angular2-redux";
import parts from "./reducers/parts-reducer"
import cart from "./reducers/cart-reducer"
import users from "./reducers/users-reducer"
import films from "./reducers/films-reducer"
import {PartActions} from "./actions/part-actions";
import {CartActions} from "./actions/cart-actions";
import {UserActions} from "./actions/user-actions";
import {FilmActions} from "./actions/film-actions";
const appStoreFactory = createAppStoreFactoryWithOptions({
reducers:{ parts, cart, users, films },
debug:true
});
bootstrap(AppComponent,
[
provide(AppStore, { useFactory: appStoreFactory }),
HTTP_PROVIDERS,
CartActions, PartActions, UserActions, FilmActions
]);
/* tslint:disable */
// polyfill for Object.assign (not part of TS yet)
// https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
if (!Object.assign) {
Object.defineProperty(Object, "assign", {
enumerable: false,