Viesturs Teivāns
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'})

)
    Viesturs Teivāns

    Written by

    UI/UX enthusiast, Full stack developer, CTO at @froontapp

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade