惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Docker
AI
AI
博客园 - 三生石上(FineUI控件)
腾讯CDC
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
雷峰网
雷峰网
NISL@THU
NISL@THU
S
Schneier on Security
T
Threatpost
T
Tenable Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
IT之家
IT之家
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
C
Cybersecurity and Infrastructure Security Agency CISA
P
Privacy & Cybersecurity Law Blog
I
Intezer
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
T
Threat Research - Cisco Blogs
SecWiki News
SecWiki News
AWS News Blog
AWS News Blog
博客园 - Franky
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Proofpoint News Feed
V
V2EX
Recorded Future
Recorded Future
Microsoft Security Blog
Microsoft Security Blog
S
Secure Thoughts
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
Apple Machine Learning Research
Apple Machine Learning Research
Project Zero
Project Zero
PCI Perspectives
PCI Perspectives
G
GRAHAM CLULEY
Help Net Security
Help Net Security
Cloudbric
Cloudbric
Recent Announcements
Recent Announcements
V
Visual Studio Blog
Hacker News: Ask HN
Hacker News: Ask HN
N
News and Events Feed by Topic
C
CERT Recently Published Vulnerability Notes
The Cloudflare Blog
Forbes - Security
Forbes - Security
C
Cisco Blogs
O
OpenAI News
www.infosecurity-magazine.com
www.infosecurity-magazine.com

Maggie Appleton

The Dark Forest and Generative AI One Developer, Two Dozen Agents, Zero Alignment Gas Town’s Agent Patterns, Design Bottlenecks, and Vibecoding at Scale January 2026 | Maggie Appleton A Treatise on AI Chatbots Undermining the Enlightenment A Brief History & Ethos of the Digital Garden Vibe Code is Legacy Code May 2025 | Maggie Appleton Home-Cooked Software and Barefoot Developers Statistically, When Will My Baby Be Born? Speculative Calendar Events ChatGPT Would be a Decent Policy Advisor March 2025 | Maggie Appleton The Expanding Dark Forest and Generative AI Humanity's Last Exam Squish Meets Structure Common Misconceptions in AI Undetected AI Exam Answers Unbaited Smidgeons Growing a Human: The First 30 Weeks How to Import Academic Papers from Zotero into Tana December 2024 | Maggie Appleton Aesthetic Command Lines with Hyper, Spaceship, and Oh My Zsh Leaving Elicit July 2024 | Maggie Appleton A Short History of Bi-Directional Links The Pattern Language of Project Xanadu Assumed Audiences Ambient Co-presence On Opening Essays, Conference Talks, and Jam Jars Spinning Worlds, Seasickness, and Dealing with Vestibular Neuritis A Collection of Design Engineers Gathering Structures Daily Notes Pages Historical Trails December 2023 | Maggie Appleton September 2023 | Maggie Appleton Digital Gardening for Non-Technical Folks Language Model Sketchbook, or Why I Hate Chatbots June 2023 | Maggie Appleton Computational Notebooks Folk Interfaces Reverse Outlining with Language Models Command K Bars Spatial Web Browsing A Picture Worth a Thousand Programmes Programmable Notes Programming Portals Teenage Skeuomorphic Desktop Designs Growing the Evergreens Why You Own an iPad and Still Can't Draw A Brief Introduction to Digital Anthropology Transclusion and Transcopyright Dreams The Block-Paved Path to Structured Data Empty Pointers and Constellations of AI Metaphors We Web By The Gift Economy Epistemic Disclosure November 2022 | Maggie Appleton Joining Ought July 2022 | Maggie Appleton The Linear Oppression of Note-taking Apps Paleolithic Nostalgia Interoperable Personal Libraries and Ad Hoc Reading Groups The Finest Narrative Non-Fiction Essays Algorithmic Transparency October 2021 | Maggie Appleton Plebeian Programming with Keyboard Maestro The Cultural Anthropology of React August 2021 | Maggie Appleton Natureculture, Moral Purity, and Cultural Boundaries The Echo & Narcissus Writing Club Pink, Soft, Glittering Developers Fetishism & Mechanical Keyboards Making Programming Visual, Spatial, and Learnable Organic, Local, Artisan Data Storage Positioning Elements & Scrollytelling in CSS Painting Roam Research with Custom CSS A Digital Anthropology Reading List The Eponymous Laws of Programming A History of Cyborgs Neologisms GreenSock Animations with React Hooks The Bare Essentials of Greensock September 2020 | Maggie Appleton Illustrating Gatsby's Key Concepts Problematic Proteins New Harvest & Illustrating the Cultivated Meat Podcast Synecdoche: Drawing the Part for the Whole A Meta-Tour of This Site Douglas, Dirt, and Matter Out of Place The Knowledge Hydrant A Naïve Exploration of Computer-Supported Collaborative Learning Silent Synchronous Reading Sessions What the Fork is React Suspense? Visually Workshopping the AWS Cloud Are Data Unions the Future of Data? Pattern Languages in Programming and Interface Design A Metaphorical Reading Collection
Immutable Data with Immer and Personal Assistant Bots
2019-08-10 · via Maggie Appleton

Let’s talk about immutable data. With socks. And personal assistant bots. I know, you’re already so excited.

Immutability and state are two developer buzzwords it took me forever to “get.”

Their underlying meanings aren’t necessarily that complex. But it’s tough to fully comprehend what they mean, and why they’re important, until you see them in action.

State just means the way an application is at a single point in time.

For example, if we’ve typed “how does CSS grid work” into the search bar, and there are three checkboxes ticked, and we have a dropdown menu open that’s the current “state” of things. If we close the menu that’s a state change.

Behind the scenes in apps we have to account for every state an app could be in (which gets expontential very quicky). This is usually called “managing state” and appears to be a neverending problem

Immutable State is one approach to solving our complex state problem – it simply means making a second copy of things before you change them.

It’s the same as copying and pasting a new ImportantThing_Version2_Draft.md document before liberally changing enourmous chunks of it. Then when you realise your poor editing choices and want to go back to the original version, it’s there waiting for you.

Writing immutable code is a wildly popular concept in general. And a good idea when you don’t want to muck everything up.


Okay now you’re all caught up on the jargon. Lets get to some illustrated notes.

These are from a course Michel Weststrate made about their elegant new tool Immer – it helps handle manage immutable state in a sane way.

https://egghead.io/courses/immutable-javascript-data-structures-with-immer

Michel walks us through building a gifting app with React & Immer that seamlessly handles all the messy state work.

Immer is a small JS library that makes working with immutable state easy and enjoyable. It's like a small assistant that helps you make copies and edits to documents.

Immer's produce function does all the work - it takes a state object and runs a draft function telling the state how it should change.

The product function supports currying - which is when we nest functions inside others to make our code composable

We can easily use immer with other libraries like React and write callback functions using immer's produce function


CSS is awesome cup

Yes the cup in the illustration is based on this classic CSS one that I don’t own, but kind of want to.

Want more illustrated notes on web development?

Take a look at Testing Apps with Cypress

Testing Apps with Cypress

Illustrated notes on how to test web apps with Cypress , The JAMStack, Gatsby & Contentful

The JAMStack, Gatsby & Contentful

Illustrated notes on the JAMstack, Gatsby & Contentful
or A Fresh Serving of JavaScript ES2019

A Fresh Serving of JavaScript ES2019

Illustrated notes on the new language changes in JavaScript ES2019