Reactimal

Reactimal is a set of tools that can be used to express your code as a logic graph using reactive programming methods.

In computer science, we learn that a function is a process with some inputs and an output. Imperative programming languages focus on constructing the operations that convert inputs to output. Since a program is a collection of functions, there is inevitably shared state that the many functions act on. In this situation, one value in the shared state could be updated through any number of functions. The situation that causes this is called "spaghetti code" where code size grows to the point such that it's difficult to understand the code path that each task takes through the code base.

To avoid this situation, Reactimal maintains links to the whole logic graph so it's easy to see what outputs come from what inputs.

Reactimal provides the following reactive programming primitives. Each type of primitive is subscribable and provides a single output value, but differ in how they receive their input. In short:

  • A property directly receives a single value as an entry point to a logic graph
  • A container wraps javascript container objects and triggers an update when a property changes.
  • A computed only receives values from other subscribables.
  • A stream is the asynchronous version of a computed.

Reactimal also includes a few utilities that may be useful when building logic graphs.

Inspiration

Reactimal is the result of years of learning from the following projects: