State Monad in JavaScript
Learn how to deal with stateful computations in functional JavaScript with the help of the State Algebraic Data Type. This course covers constructing a Stateful Monad, mapping and evaluating state, updating and modifying state, combining computations, and applying them to functions. Refactor your stateful code to use a State Monad for cleaner and more efficient code. Start mastering state management in functional JavaScript today.
Dealing with stateful computations can be a challenge when writing purely functional JavaScript. They can result in undesired variable declaration at best and boilerplate state management code in every function dependent on the state at its worst.
In this course we will explore a well know Algebraic Data Type named State, that is built from the ground up to address these ????cerns. While this course will be focused around a State implementation provided by a library named
, a majority of the techniques we learn here can be used with most of the State implementations in the wild.
Course Content
Construct a Stateful Monad
Map And Evaluate State With A Stateful Monad
Substitute State Using Functions With A State Monad
Update The State Of A State Monad
Modify The State Of A State Monad
Combine Stateful Computations Using A State Monad
Combine Stateful Computations Using Composition
Apply Stateful Computations To Functions
Refactor Stateful Code To Use A State Monad