本文整理匯總了TypeScript中@ngrx/store-log-monitor.useLogMonitor函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript useLogMonitor函數的具體用法?TypeScript useLogMonitor怎麽用?TypeScript useLogMonitor使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了useLogMonitor函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: main
export function main(initialHmrState?: any): Promise<any> {
return bootstrap(App, [
// To add more vendor providers please look in the platform/ folder
...PLATFORM_PROVIDERS,
...ENV_PROVIDERS,
...APP_PROVIDERS,
instrumentStore({
monitor: useLogMonitor({
visible: true,
position: 'right'
})
}),
provideStore({})
])
.then(decorateComponentRef)
.catch(err => console.error(err));
}
示例2: enableProdMode
import { provideStore } from '@ngrx/store'
import { instrumentStore } from '@ngrx/store-devtools'
import { useLogMonitor } from '@ngrx/store-log-monitor'
import { runEffects } from '@ngrx/effects'
import { AppComponent, environment } from './app/'
import { giphy as reducer } from './app/reducers/giphy'
import { GiphyEffects } from './app/effects/giphy'
import services from './app/services/index'
import { GiphyActions } from './app/actions/giphy'
if (environment.production) {
enableProdMode()
}
bootstrap(AppComponent, [
provideStore({ giphy: reducer }),
runEffects([ GiphyEffects ]),
services,
[GiphyActions],
instrumentStore({
monitor: useLogMonitor({
visible: true,
position: 'right'
})
})
])
示例3: provideDB
* Override the default location strategy with `HashLocationStrategy`
*/
{ provide: LocationStrategy, useClass: HashLocationStrategy },
/**
* provideDB sets up @ngrx/db with the provided schema and makes the Database
* service everywhere.
*/
provideDB(schema),
/**
* instrumentStore() sets up the @ngrx/store-devtools providers
*/
instrumentStore({
monitor: useLogMonitor({
position: 'right',
visible: true
})
}),
/**
* Finall we provide additional services and action creators so they can
* be used by all of our components, effects, and guards.
*/
services,
actions,
guards,
disableDeprecatedForms(),
provideForms()
]);
示例4: instrumentOptions
export function instrumentOptions() {
return {
monitor: useLogMonitor({ visible: true, position: 'right' })
};
}
示例5: useLogMonitor
import {Provider} from '@angular/core';
import {provideStore} from '@ngrx/store';
import {instrumentStore} from '@ngrx/store-devtools';
import {useLogMonitor} from '@ngrx/store-log-monitor';
// Reducers
import {counterReducer} from '../counter/counter.reducer';
export interface AppState {
counter: number;
}
export const STORE_PROVIDERS: Provider[] = [
...provideStore(
{
counter: counterReducer
}, {
counter: 55
}
),
...instrumentStore({
monitor: useLogMonitor({
// Default log monitor options
position: 'bottom',
visible: false,
size: 0.3
})
}),
];
示例6: disableDeprecatedForms
import { provideStore } from '@ngrx/store';
import { peopleReducer } from './app/reducers/peopleReducer';
import { partyFilter } from './app/reducers/partyFilterReducer';
import { instrumentStore } from '@ngrx/store-devtools';
import { useLogMonitor } from '@ngrx/store-log-monitor';
import { disableDeprecatedForms, provideForms } from '@angular/forms';
import "angular2-materialize";
let providers = [
disableDeprecatedForms(),
provideForms(),
provideStore({people: peopleReducer, partyFilter: partyFilter})
];
if (environment.production) {
enableProdMode();
}
if (!environment.production) {
providers.push(instrumentStore({
monitor: useLogMonitor({
visible: false,
position: 'bottom'
})
}));
}
bootstrap(AppComponent, providers).catch((e) => {
console.log(e);
}) ;
示例7: bootstrap
import {bootstrap} from "@angular/platform-browser-dynamic";
import {HashLocationStrategy, LocationStrategy, APP_BASE_HREF} from "@angular/common";
import "rxjs/add/operator/do";
import {store} from "./common/store";
import {HTTP_PROVIDERS} from "@angular/http";
import {instrumentStore} from "@ngrx/store-devtools";
import {provideStore} from "@ngrx/store";
import {useLogMonitor} from "@ngrx/store-log-monitor";
import {AppRoutes} from "./common/routes";
import {provideRouter} from "@angular/router";
import {provideForms} from "@angular/forms";
import {AuthenticatedGuard} from "./common/authenticated.guard";
bootstrap(WineCellarApp, [
provideRouter(AppRoutes),
HTTP_PROVIDERS,
{provide: APP_BASE_HREF, useValue: "/"},
{provide: LocationStrategy, useClass: HashLocationStrategy},
provideForms(),
provideStore(store),
AuthenticatedGuard,
instrumentStore({
monitor: useLogMonitor({
visible: false,
position: "right"
})
}),
])
.catch((err: any) => console.error(err));