当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript angular2-redux.createAppStoreFactoryWithOptions函数代码示例

本文整理汇总了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,
开发者ID:Anhmike,项目名称:angular2-tutorial,代码行数:31,代码来源:main.ts

示例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;
开发者ID:KulikovskyIgor,项目名称:sport-route,代码行数:14,代码来源:store.ts

示例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,
开发者ID:besarthoxhaj,项目名称:react-intermediate3,代码行数:32,代码来源:main.ts


注:本文中的angular2-redux.createAppStoreFactoryWithOptions函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。