Skip to content

Instantly share code, notes, and snippets.

@andywillis
andywillis / gist:fb021930aa1efb0a784fdb697637d862
Created April 11, 2025 14:40 — forked from pixelprodev/gist:190b6b9fa16b443e9c1668ad65003f45
Domain Object Style state management using @preact/signals-react and React 19

I'll preface this by saying I have a LOT of freedom in the app that I'm currently working on, and I've taken that liberty to push the envelope of curiosities. I recently read about signals (specifically @preact/signal-react) and it got me to thinking. This is the brainchild first iteration of this. I am posting this with hopes that one of two things happen. I hope first and foremost that I can learn from someone in some way here. If I'm short-sighted or missing something, point it out, please. I've been coding for years but still feel brand new and still make a lot of mistakes. If it helps someone else learn something, well that's ok too.

Conceptually, I build my domain objects using a building block class that I call a "ReactiveMap". Feel free to swap this out for any type of implementation you want to use for your domain model's base, but this works for my particular use case.

The ReactiveMap mimics the api of a javascript Map object with some utility additions, and adds the ability for you to

@andywillis
andywillis / GitHub-Project-Guidelines.md
Created March 20, 2019 15:04 — forked from rsp/GitHub-Project-Guidelines.md
Git Strict Flow and GitHub Project Guidelines - setup rules and git flow for commercial and open-source projects by @rsp

Git Strict Flow and GitHub Project Guidelines

Or how to turn this:

into this: