JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q23098F
  • License MIT

An Rx implementation of redux-saga for @ngrx/store

Package Exports

  • store-saga

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (store-saga) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

store-saga

An Rx implementation of redux-saga for @ngrx/store and Angular 2.

Based on redux-saga-rxjs by Salsita, with inspiration from redux-saga by Yelouafi.

Usage

store-saga depends on @ngrx/store and Angular 2. After configuring @ngrx/store, install store-saga:

npm install store-saga --save

Write a saga:

import {createSaga} from 'store-saga';

export const increment = createSaga(function(){
  return saga$ => saga$
    .filter(saga => saga.action.type === 'DECREMENT')
    .map(() => {
      return { type: 'INCREMENT'}
    });
});

Install the store-saga middleware in the same place you provide your ngrx/store:

import {installSagaMiddleware} from 'store-saga';

bootstrap(App, [
  provideStore(reducer, initialState),
  installSagaMiddleware(increment)
]);

Documentation

  • Utilities - Information on various utility functions
  • SagaRunner - Use the SagaRunner service to run, stop, and pause saga effects dynamically
  • Testing - Learn how to test saga effects using the provided SagaTester service