Skip to content

Instantly share code, notes, and snippets.

@JurajMlich
Last active August 14, 2019 05:58
Show Gist options
  • Save JurajMlich/b26629d4b61690960a78eb14afe4a49d to your computer and use it in GitHub Desktop.
Save JurajMlich/b26629d4b61690960a78eb14afe4a49d to your computer and use it in GitHub Desktop.
import {ActionReducer, ActionReducerMap, MetaReducer} from '@ngrx/store';
import {State} from './root.state';
import {environment} from '../../environments/environment';
export const rootReducers: ActionReducerMap<State> = {
// YOUR REDUCERS HERE
};
export const rootMetaReducers: MetaReducer<State>[] = [];
if (environment.hmr) {
rootMetaReducers.push((reducer: ActionReducer<any>): ActionReducer<any> => {
return function (state: any, action: any) {
if (action.type === 'SET_ROOT_STATE') {
return action.payload;
}
return reducer(state, action);
};
});
}
@Prinsn
Copy link

Prinsn commented Aug 13, 2019

I'm assuming you've truncated this, as State is defined in a basic reducer.

You shouldn't exclude code if you're going to suggest that this is the entire file.

@JurajMlich
Copy link
Author

@Prinsn will include the whole file, give me a few hours

@Prinsn
Copy link

Prinsn commented Aug 14, 2019 via email

@JurajMlich
Copy link
Author

Updated ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment