本文整理汇总了TypeScript中@ngrx/store.provideStore函数的典型用法代码示例。如果您正苦于以下问题:TypeScript provideStore函数的具体用法?TypeScript provideStore怎么用?TypeScript provideStore使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了provideStore函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: bootstrap
import 'zone.js';
import 'reflect-metadata';
import {bootstrap} from 'angular2/platform/browser';
import {App} from './app';
import {provideStore} from '@ngrx/store';
import {APP_REDUCERS} from './reducers/reducers';
import {APP_ACTIONS} from './actions/actions';
bootstrap(App, [
ELEMENT_PROBE_PROVIDERS,
APP_ACTIONS,
provideStore(APP_REDUCERS)
]);
示例2: provideStore
import {routerReducer, routerMiddleware, RouterState} from 'ngrx-store-router';
// app
import {nameListReducer} from './services/name-list.service';
import {MULTILINGUAL_PROVIDERS, MultilingualStateI, multilingualReducer} from '../i18n.framework/index';
import { PeopleService } from './services/person.service';
import { LineChartDirective } from './services/lineChart.service';
// state definition
export interface AppStoreI {
router: RouterState;
i18n: MultilingualStateI;
names: Array<string>;
};
export const APP_PROVIDERS: any[] = [
MULTILINGUAL_PROVIDERS,
provideStore({
router: routerReducer,
i18n: multilingualReducer,
names: nameListReducer
}),
routerMiddleware
];
// services
export * from './services/app-config.service';
export * from './services/person.service';
export * from './services/lineChart.service';
export * from './services/name-list.service';
示例3: bootstrap
import {bootstrap} from '@angular/platform-browser-dynamic';
import {HTTP_PROVIDERS} from '@angular/http';
import {provideRouter} from '@ngrx/router';
import {provideStore} from '@ngrx/store';
import {AppComponent} from './app.component';
import {routesConfig} from './routes.config';
import {ApiService} from './common/api.service';
import {locations} from './common/reducers/locations';
import {issues} from './common/reducers/issues';
import {customers} from './common/reducers/customers';
bootstrap(AppComponent, [
HTTP_PROVIDERS,
ApiService,
provideStore({locations, issues, customers}),
provideRouter(routesConfig)
]);
示例4: provideStore
// libs
import {provideStore} from '@ngrx/store';
// app
import {nameListReducer} from './services/name-list.service';
import {fromHttpListReducer} from './services/from-http.service'
import {MULTILINGUAL_PROVIDERS, MultilingualStateI, multilingualReducer} from '../i18n.framework/index';
// state definition
export interface AppStoreI {
i18n: MultilingualStateI;
names: Array<string>;
adverts: Array<string>;
};
export const APP_PROVIDERS: any[] = [
MULTILINGUAL_PROVIDERS,
provideStore({
i18n: multilingualReducer,
names: nameListReducer,
adverts: fromHttpListReducer
})
];
// services
export * from './services/app-config.service';
export * from './services/name-list.service';
export * from './services/from-http.service';
示例5: provideStore
// App
export * from './app.component';
export * from './app.service';
import {provideStore} from '@ngrx/store';
import {notesReducer, selectedNoteReducer} from './notes/notesReducers';
import {NoteService} from './notes/NoteService';
import {toast2} from './toast2/toast2';
import {Toast2Service} from './toast2/Toast2Service';
import {ApiHttp} from './util/ApiHttp';
import {auth} from './auth/reducers/auth';
import {AuthService} from './auth/AuthService';
import {spinner} from './util/Spinner.ts';
import {SpinnerService} from './util/Spinner';
import {AppState} from './app.service';
// Application wide providers
export const APP_PROVIDERS = [
AppState,
Toast2Service,
SpinnerService,
ApiHttp,
AuthService,
NoteService,
provideStore({toast2, spinner, auth, notesReducer, selectedNoteReducer})
];
示例6: provideStore
t.bep(() => {
return [
provideStore({names: nameListReducer}),
NameListService
];
});
示例7: provideStore
import { provideStore } from '@ngrx/store';
import { people } from '../_people/reducers/people.reducer';
import { auth } from '../_auth/reducers/auth.reducer';
import { entities } from './entities.reducer';
import { errors } from './errors.reducer';
import { notifications } from './notifications.reducer';
export const APP_REDUCERS_PROVIDER = provideStore({
auth,
people,
entities,
errors,
notifications
});
示例8: provide
// libs
import {Angulartics2} from 'angulartics2';
import {Angulartics2Segment} from 'angulartics2/src/providers/angulartics2-segment';
import {provideStore} from '@ngrx/store';
import {TranslateService} from 'ng2-translate/ng2-translate';
// app
import {ConsoleService, LogService} from '../core.framework/index';
import {AnalyticsService} from '../analytics.framework/index';
import {AppConfigService} from '../app.framework/index';
import {MultilingualService, multilingualReducer} from '../i18n.framework/index';
import {NSAngulartics2Segment} from './services/ns-angulartics2-segment.service';
import {NSLogService} from './services/ns-log.service';
// custom i18n language support
MultilingualService.SUPPORTED_LANGUAGES = AppConfigService.SUPPORTED_LANGUAGES;
export const NS_APP_PROVIDERS: any[] = [
HTTP_PROVIDERS,
provide(ConsoleService, { useValue: console }),
provide(LogService, { useClass: NSLogService }),
provideStore({
i18n: multilingualReducer,
}),
Angulartics2,
provide(Angulartics2Segment, { useClass: NSAngulartics2Segment }),
AnalyticsService,
TranslateService,
MultilingualService
];
示例9: bootstrap
import { bootstrap } from '@angular/platform-browser-dynamic' ;
import { AppComponent } from './app.component' ;
import { editorReducer } from './editor/editor.service' ;
import { provideStore } from '@ngrx/store' ;
bootstrap(AppComponent, [
provideStore({ editor: editorReducer })
]) ;
示例10: beforeEachProviders
beforeEachProviders(() => [
TeacherService,
provideStore(REDUCERS)
]);