Spoke
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.
by Micosmo
Price History +
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 events
- State - reactive container for values
- Effect / Phase / Reaction - self-cleaning blocks of logic
- Memo - computed reactive value
- Dock - dynamic attach point for effects
The mental model is a tree of nested lifetimes. When state changes, subtrees hot-reload automatically:
- Stale behaviour is disposed
- New behaviour is set up
- Persistent behaviour stays in sync with runtime state
Spoke is free and open source.