Skip to content

Instantly share code, notes, and snippets.

@fxck
Created May 11, 2016 15:05
Show Gist options
  • Save fxck/7620d17ffc3f34c1026aa3a7c898f603 to your computer and use it in GitHub Desktop.
Save fxck/7620d17ffc3f34c1026aa3a7c898f603 to your computer and use it in GitHub Desktop.

How to run nightly version of @ngrx/store along with new @ngrx/effects

Add new packages to your dependencies

Effects and store v2 are not on npm yet, so download them from my github.

"@ngrx/core": "1.0.0",
"@ngrx/store": "fxck/store#v2-test",
"@ngrx/effects": "fxck/effects",

Change your sagas to effects

Guide is here https://github.com/ngrx/effects/blob/master/README.md

Simple logger service

No middleware anymore, to get simple logger running, import these

import { combineReducers, provideStore } from '@ngrx/store';
import { compose } from '@ngrx/core/compose';

import { storeLogger } from './app/core/services/store-logger.services';

where storeLogger is this https://gist.github.com/fxck/8b7b1cd5da023c0384239edcecf18c97

and provide your rootReducer like this

provideStore(compose(storeLogger, combineReducers)({
  auth,
  people,
  clients
})),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment