Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

egghead.io

State Monad in JavaScript

via egghead.io

Overview

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 crocks, a majority of the techniques we learn here can be used with most of the State implementations in the wild.

Syllabus

  • 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

Taught by

Ian Hofmann-Hicks

Reviews

4.1 rating at egghead.io based on 64 ratings

Start your review of State Monad in JavaScript

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.