{"id":14744,"date":"2022-03-23T13:36:09","date_gmt":"2022-03-23T11:36:09","guid":{"rendered":"https:\/\/mozaicworks.com\/?p=14744"},"modified":"2022-03-23T13:39:15","modified_gmt":"2022-03-23T11:39:15","slug":"a-useless-web-pattern","status":"publish","type":"post","link":"https:\/\/mozaicworks.com\/fun-innovative\/a-useless-web-pattern","title":{"rendered":"A Useless Web Pattern"},"content":{"rendered":"\n

I love to explore various options for design when doing my deliberate practice. Sometimes I realize that these options are useless in nature, yet try them anyway – because discovering new things is fun! And because you never know what you’ll learn down the line.<\/p>\n\n\n\n

While recording a series of videos “Alex learns htmx<\/a>“, I realized that I could use the state monad to manage state in a web application. At this point, you probably have a bunch of questions: What is a monad? What is the state monad? How would you do that? Why is it useless? <\/p>\n\n\n\n

Well, let’s see.<\/p>\n\n\n\n

A monad is a design pattern from functional programming. The state monad in particular has the following components:<\/p>\n\n\n\n