
Spoke is a tiny reactivity engine for C# and Unity.
Inspired by React, but targeting the needs of game-logic, it's built to tame the chaos when many systems interact in dynamic, emergent ways.Spoke is a declarative reactivity engine for simulated worlds.It's designed for complex games with nested, entangled, and long-lived behaviours.What's a long-lived behaviour?Logic that activates on one frame and deactivates on a later frame.Example:When there is an incoming missile, play the missile alert sound; when there isn’t, stop it.Only play the missile alert sound when the sensor systems aren't damaged.This example is only two levels deep. Spoke can manage many more levels and stay clear, cohesive, and bug-free.What's inside?Spoke is a toolbox of composable reactive primitives:Trigger - fire-and-forget eventsState - reactive container for valuesEffect / Phase / Reaction - self-cleaning blocks of logicMemo - computed reactive valueDock - dynamic attach point for effectsThe mental model is a tree of nested lifetimes. When state changes, subtrees hot-reload automatically:Stale behaviour is disposedNew behaviour is set upPersistent behaviour stays in sync with runtime stateSpoke is free and open source.You can find the GitHub repo here.FeaturesDeclarative reactivity engine for general purpose logicSupported OSAllLink to documentationIn the github repo