Better README text

This commit is contained in:
Timothy Farrell 2018-11-02 20:08:50 +00:00
parent 1f8c3b7a78
commit 921b51e2b3

View File

@ -1,32 +1,31 @@
# Reactimal # Reactimal
Reactimal is a set of primitives that can be used to express your code as a logic graph using reactive Reactimal provides a set of primitives that can be used to express your code as a logic graph using
programming methods. reactive programming methods. Reactive programming inverts the dependency relationship between
functions and their parameters. No longer do callers need to know the signature of the functions
In computer science, we learn that a function is a process with some inputs and an output. they call. Instead computed values subscribe to scalar properties or other computed values. The
Imperative programming languages focus on constructing the operations that convert inputs to output. reactive method improves code readability and reduces the tendency toward spaghetti code.
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 Reactimal provides the following reactive programming primitives. Each type of primitive is
[subscribable](./subscribable.md) and provides a single output value, but differ in how they receive [subscribable](./docs/subscribable.md) and provides a single output value, but differ in how they
their input. In short: receive their input.
- A [property](./docs/property.md) directly receives a single value as an entry point to a logic ## Input Primitives
graph
- A [property](./docs/property.md) directly receives a scalar value. It serves as an entry point to
a logic graph for scalar values.
- A [container](./docs/container.md) wraps javascript container objects and triggers an update when - A [container](./docs/container.md) wraps javascript container objects and triggers an update when
a property changes. a property changes or a method is called. (NOTE: Nestable container changes are tracked only one
- A [computed](./docs/computed.md) only receives values from other subscribables. level deep.)
## Computational Primitives
- A [computed](./docs/computed.md) only receives values from other subscribables but serves to
compute new values. This is the function in the logic graph.
- A [stream](./docs/stream.md) is the asynchronous version of a computed. - A [stream](./docs/stream.md) is the asynchronous version of a computed.
Reactimal also includes a few [utilities](./docs/utilities.md) that may be useful when building logic Reactimal also includes a few [utilities](./docs/utilities.md) that may be useful when building
graphs. logic graphs.
## Inspiration ## Inspiration