當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript store-saga.installSagaMiddleware函數代碼示例

本文整理匯總了TypeScript中store-saga.installSagaMiddleware函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript installSagaMiddleware函數的具體用法?TypeScript installSagaMiddleware怎麽用?TypeScript installSagaMiddleware使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了installSagaMiddleware函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: main

export function main() {
  return bootstrap(ShoppingCartApp, [
      ELEMENT_PROBE_PROVIDERS,
      provideStore(APP_REDUCERS),
      installSagaMiddleware(...shopSagas),
      instrumentStore(),
      devtoolsConfig({
          position: 'bottom',
          visible: true,
          size: 0.3
      })
  ])
  .catch(err => console.error(err));
}
開發者ID:Hongbo-Miao,項目名稱:ngrx-examples,代碼行數:14,代碼來源:bootstrap.ts

示例2: main

export function main() {
  return bootstrap(ArtistPlaylistApp, [
      apiInjectables,
      ELEMENT_PROBE_PROVIDERS,
      HTTP_PROVIDERS,
      AudioServiceAction,
      provide(BrowserXhr, { useClass: CustomBrowserXhr }),
      provideStore(APP_REDUCERS),
      usePreMiddleware(actionLog),
      usePostMiddleware(stateLog),
      installSagaMiddleware(...audiomachineSagas)
  ])
  .catch(err => console.error(err));
}
開發者ID:willSonic,項目名稱:angular2-exp-ngrx,代碼行數:14,代碼來源:bootstrap.ts

示例3: main

export function main(initialHmrState?: any): Promise<any> {

  return bootstrap(App, [
   ...HTTP_PROVIDERS,
    ...ENV_PROVIDERS,
    ...PROVIDERS,
    ...DIRECTIVES,
    ...PIPES,
    ...APP_PROVIDERS,  
    provideStore(todos,initialState),
    provideRouter(routes),
    installSagaMiddleware(...my_sagas)

  ])
  .catch(err => console.error(err));

}
開發者ID:JamesUlph,項目名稱:ng2-start,代碼行數:17,代碼來源:main.browser.ts

示例4: bootstrap

import {reducer} from './app/reducers/repos';
import sagas from './app/sagas/repos';

import {SeedApp} from './app/seed-app';

const actionLog: Middleware = action => {
    return action.do(val => {
        console.warn('DISPATCHED ACTION: ', val)
    });
};

const stateLog: Middleware = state => {
    return state.do(val => {
        console.log('NEW STATE: ', val)
    });
};

bootstrap(SeedApp, [
  provideStore(reducer, {}),
  usePreMiddleware(actionLog),
  usePostMiddleware(stateLog),
  installSagaMiddleware(...sagas),
  instrumentStore(),
  HTTP_PROVIDERS,
  ROUTER_PROVIDERS,
  provide(LocationStrategy, {useClass: HashLocationStrategy})
])
.catch(err => console.error(err));

開發者ID:Lube,項目名稱:angular2-seed,代碼行數:28,代碼來源:app.ts

示例5: installSagaMiddleware

import { installSagaMiddleware } from 'store-saga';
import { taskSagas } from './tasks';


export const SAGA_PROVIDERS: any[] = installSagaMiddleware(
  ...taskSagas
);
開發者ID:willSonic,項目名稱:todo-angular2-ngrx,代碼行數:7,代碼來源:sagas.ts

示例6: installSagaMiddleware

import { FORM_PROVIDERS } from 'angular2/common';

// Angular 2 Http
import { HTTP_PROVIDERS } from 'angular2/http';

// Angular 2 Material
// TODO(gdi2290): replace with @angular2-material/all
import { MATERIAL_PROVIDERS } from './angular2-material2';

// 3rd party providers
import { installSagaMiddleware } from 'store-saga';
import { loggerMiddleware } from 'ngrx-store-logger';


const THIRDPARTY_PROVIDERS = [
  installSagaMiddleware(),
  ...loggerMiddleware()
];

/*
* Application Providers/Directives/Pipes
* providers/directives/pipes that only live in our browser environment
*/
export const APPLICATION_PROVIDERS = [
  ...FORM_PROVIDERS,
  ...HTTP_PROVIDERS,
  ...MATERIAL_PROVIDERS,
  ...THIRDPARTY_PROVIDERS
];

export const PROVIDERS = [
開發者ID:Lukinos,項目名稱:ngrx-example,代碼行數:31,代碼來源:providers.ts


注:本文中的store-saga.installSagaMiddleware函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。