Created
May 21, 2017 14:15
-
-
Save stockwellb/a2a7e98999df0e037699a638c386901f to your computer and use it in GitHub Desktop.
ngrx code example for medium article
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function reducer( | |
state: State, action: Rate.Actions | Rates.Actions): State { | |
switch (action.type) { | |
case Rates.ActionTypes.LOAD: { | |
const rates = action.payload; | |
// return new state | |
} | |
case Rates.ActionTypes.LOAD_SUCCESS: { | |
const rates = action.payload; | |
// return new state | |
} | |
case Rate.ActionTypes.SELECT: { | |
const rate = action.payload; | |
// return new state | |
} | |
default: { return state; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment