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


TypeScript EffectsModule.run方法代码示例

本文整理汇总了TypeScript中@ngrx/effects.EffectsModule.run方法的典型用法代码示例。如果您正苦于以下问题:TypeScript EffectsModule.run方法的具体用法?TypeScript EffectsModule.run怎么用?TypeScript EffectsModule.run使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@ngrx/effects.EffectsModule的用法示例。


在下文中一共展示了EffectsModule.run方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: Http

const testModuleConfig = () => {
  TestBed.configureTestingModule({
    imports: [
      NoopAnimationsModule,
      CoreModule,
      RouterTestingModule,
      AnalyticsModule,
      MultilingualModule,
      StoreModule.provideStore({ home: homeReducer }),
      EffectsModule.run(NameListEffects),
      MdInputModule,
      MdButtonModule
    ],
    declarations: [ HomeComponent, TestComponent ],
    providers: [
      NameListService,
      BaseRequestOptions,
      MockBackend,
      provideConsoleTarget(LogLevel.Debug),
      {
        provide: Http,
        useFactory: function (backend: ConnectionBackend, defaultOptions: BaseRequestOptions) {
          return new Http(backend, defaultOptions);
        },
        deps: [ MockBackend, BaseRequestOptions ]
      }
    ]
  });
};
开发者ID:our-city-app,项目名称:plugin-homepage-example,代码行数:29,代码来源:home.component.spec.ts

示例2: Http

const testModuleConfig = () => {
  TestBed.configureTestingModule({
    imports: [
      CoreModule,
      SharedModule,
      RouterTestingModule,
      AnalyticsModule,
      MultilingualModule,
      StoreModule.provideStore({ sample: reducer }),
      EffectsModule.run(SampleEffects)
    ],
    declarations: [HomeComponent, TestComponent],
    providers: [
      LanguageProviders,
      NameListService,
      BaseRequestOptions,
      MockBackend,
      {
        provide: Http, useFactory: function (backend: ConnectionBackend, defaultOptions: BaseRequestOptions) {
          return new Http(backend, defaultOptions);
        },
        deps: [MockBackend, BaseRequestOptions]
      }
    ]
  });
};
开发者ID:hellofornow,项目名称:angular2-seed-advanced,代码行数:26,代码来源:home.component.spec.ts

示例3:

const testModuleConfig = (options?: any) => {
  let langProvider = [];
  if (options.languages) {
    langProvider.push({
      provide: Languages,
      useValue: options.languages
    });
  }
  TestBed.configureTestingModule({
    imports: [
      CoreModule.forRoot([
        { provide: WindowService, useValue: window },
        { provide: ConsoleService, useValue: console }
      ]),
      Angulartics2Module.forRoot([
        Angulartics2Segment
      ]),
      StoreModule.provideStore({ i18n: reducer }),
      EffectsModule.run(MultilingualEffects),
      RouterTestingModule
    ],
    providers: [
      TEST_CORE_PROVIDERS(options),
      TEST_MULTILINGUAL_PROVIDERS(),
      langProvider
    ]
  });
  TestBed.compileComponents();
};
开发者ID:hellofornow,项目名称:angular2-seed-advanced,代码行数:29,代码来源:multilingual.service.spec.ts

示例4:

const testModuleConfig = (options?: any) => {
  TestBed.configureTestingModule({
    imports: [
      CoreModule.forRoot([
        { provide: WindowService, useValue: window },
        { provide: ConsoleService, useValue: console }
      ]),
      StoreModule.provideStore({ i18n: reducer }),
      EffectsModule.run(MultilingualEffects),
      RouterTestingModule
    ],
    providers: [
      TEST_CORE_PROVIDERS(options),
      TEST_MULTILINGUAL_PROVIDERS()
    ]
  });
};
开发者ID:MarkWalls,项目名称:angular2-seed-advanced,代码行数:17,代码来源:multilingual.service.spec.ts

示例5:

import { LoginPage } from '../pages/user/login';
import { CreateAccountPage } from '../pages/createAccount/createAccount';
import { ListStuffPage } from '../pages/listStuff/listStuff';
import { AddStuffModal } from '../pages/listStuff/addStuffModal';

// PROVIDERS 
import { Authentication } from '../providers/authentication'

import { AuthenticationReducer } from './../reducers/authentication';
import { StoreModule } from '@ngrx/store';
import { EffectsModule } from '@ngrx/effects';
import { StoreDevtoolsModule } from '@ngrx/store-devtools';


const appEffectsRun = [
  EffectsModule.run(AuthEffects),
  EffectsModule.run(TodoEffects),
];

@NgModule({
  declarations: [
    MyApp,
    HomePage,
    CreateAccountPage,
    LoginPage,
    ListStuffPage,
    AddStuffModal
  ],
  imports: [
    IonicModule.forRoot(MyApp),
    StoreModule.provideStore({ auth: AuthenticationReducer, todos: TodoReducer }),
开发者ID:aaronksaunders,项目名称:kinvey-starter-ionic2,代码行数:31,代码来源:app.module.ts

示例6: combineReducers

  profile: IProfile;
  weather: IWeather;
}

// all new reducers should be define here
const reducers = {
  feed: feedReducer,
  profile: profileReducer,
  weather: weatherReducer
};

const productionReducer: ActionReducer<IAppState> = combineReducers(reducers);
const developmentReducer: ActionReducer<IAppState> = compose(storeFreeze, combineReducers)(reducers);

export function reducer(state: IAppState, action: Action) {
  if (environment.production) {
    return productionReducer(state, action);
  } else {
    return developmentReducer(state, action);
  }
}

export const store: ModuleWithProviders = StoreModule.provideStore(reducer);
export const instrumentation: ModuleWithProviders =  (!environment.production) ? StoreDevtoolsModule.instrumentOnlyWithExtension() : null;

export const effects: ModuleWithProviders[] = [
  EffectsModule.run(ProfileEffects),
  EffectsModule.run(FeedEffects),
  EffectsModule.run(WeatherEffects)
];
开发者ID:akazimirov,项目名称:domic,代码行数:30,代码来源:index.ts

示例7:

import { EffectsModule } from '@ngrx/effects';
import { TenantEffects } from './tenant.effects';

export const EFFECTS = [
  EffectsModule.run(TenantEffects),
];
开发者ID:llstarscreamll,项目名称:multi-tenant-app,代码行数:6,代码来源:index.ts

示例8: useLogMonitor

import { routes } from './app.routing';
import { rootReducer } from './reducers';
import { StoreDevToolsModule } from './features/store-devtools.module';
import { UserEffects } from './user/user.effects';

const STORE_DEV_TOOLS_IMPORTS = [];
if (ENV === 'development' && !AOT &&
  ['monitor', 'both'].includes(STORE_DEV_TOOLS) // set in constants.js file in project root
) STORE_DEV_TOOLS_IMPORTS.push(...[
  StoreDevtoolsModule.instrumentStore({
    monitor: useLogMonitor({
      visible: true,
      position: 'right'
    })
  })
]);

export const APP_IMPORTS = [
  EffectsModule.run(UserEffects),
  MaterialModule.forRoot(),
  ReactiveFormsModule,
  IdlePreloadModule.forRoot(), // forRoot ensures the providers are only created once
  RouterModule.forRoot(routes, { useHash: false, preloadingStrategy: IdlePreload }),
  RouterStoreModule.connectRouter(),
  StoreModule.provideStore(rootReducer),
  STORE_DEV_TOOLS_IMPORTS,
  StoreDevToolsModule
];

开发者ID:Ecafracs,项目名称:flatthirteen,代码行数:28,代码来源:app.imports.ts

示例9: combineReducers

const productionReducer: ActionReducer<IAppState> = combineReducers(reducers);
const developmentReducer: ActionReducer<IAppState> = compose(storeFreeze, combineReducers)(reducers);

export function reducer(state: IAppState, action: Action) {
  if (environment.production) {
    return productionReducer(state, action);
  } else {
    return developmentReducer(state, action);
  }
}

@NgModule()
export class DummyModule {

  static forRoot(): ModuleWithProviders {
    return {
      ngModule: CommonModule
    };
  }
}

export const store: ModuleWithProviders = StoreModule.provideStore(reducer);
export const instrumentation: ModuleWithProviders =
  (!environment.production) ? StoreDevtoolsModule.instrumentOnlyWithExtension() : DummyModule.forRoot();

export const effects: ModuleWithProviders[] = [
  EffectsModule.run(ProfileEffects),
  EffectsModule.run(FeedEffects)
];
开发者ID:venki143mca,项目名称:TeamBirthday,代码行数:29,代码来源:index.ts

示例10:

 ...effects.map(effect => EffectsModule.run(effect)),
开发者ID:xxxxlr,项目名称:echoes-ng2,代码行数:1,代码来源:index.ts


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