Highly opiniated state management for TypeScript apps.
Introduction
Telmux is a very small reactive state management library that's heavily influenced by the ELM architecture. State is
changed via Commands that are issued to the command stream of the Handler. It is upon you to provide the handler with
an update function that is responsible for interpreting commands, providing updated state in a pure manner. Side-effects
can be achieved by commands that don't change state, but run side-effects.
Telmux is agnostic about the Frontend framework you're using. It has been tested successfully with React and Vue and can provide
a suitable and typesafe alternative to Redux or Vuex.
Usage
To implemented commands, it is recommened to use some kind of sum type. We suggest using the excellent Unionize library for that.
In the following code segment, we define our commands for a simple stopwatch application:
You can use this class as a member in your frontend component. To couple your state with the component's state, it is possible to
observe a stream of changing models (as shown here for react):