This repository has been archived on 2020-09-01. You can view files and clone it, but cannot push or open issues or pull requests.
reactimal/README.md
2019-08-01 06:54:00 -04:00

1.8 KiB

Reactimal

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

Reactive programming inverts the dependency relationship between functions and their inputs. No longer do callers need to know the signature of the functions they call. Instead computed values subscribe to scalar properties or other computed values. The reactive programming method is ideal for state that changes as a result of external inputs or events. It also improves code readability and reduces the tendency toward spaghetti code.

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

Input Primitives

  • A property directly receives a scalar value. It serves as an entry point to a logic graph for scalar values.
  • A container wraps javascript container objects and triggers an update when a property changes or a method is called. (NOTE: Nestable container changes are tracked only one level deep.)

Computational Primitives

  • A computed only receives values from other subscribables but serves to compute new values. This is the function in the logic graph.
  • 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: