當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。