Aug 23, 2017 · 1 min read
Hey, Ankur!
I’m not quite getting the question. There definelty are multiple ways to solve the problem, this article is meant to ilustrate the withLatestFrom operator.
When adding a line with ADD_LINE action, the line is of course in the payload. As you can see in the lines.reducer.ts — the content of action.payload is added to the lines array (tehnically new array with lines is created from the content of previouse array plus the new one) in here:
case ADD_LINE:
return [...lines, action.payload]And also in the action example store.dispatch({type: ADD_LINE, payload: 'a new line'})
