Fairmont builds on ES6/7 standards to create a true functional reactive programming library. However, to make it easier to talk about the concepts, we've introduced some terminology. That can be a bit confusing at first. This glossary can help.
[`adapters`](#adapters) | [`iterable`](#iterable) | [`iterator`](#iterator) | [`filters`](#filters) | [`producer`](#producer) | [`producible`](#producible) | [`product`](#product) | [`reactor`](#reactor) | [`reagent`](#reagent) | [`reducers`](#reducers)Functions that take values and return producers corresponding to the given value. For example, the stream
function converts a stream object into a reactor.
Any value that can be turned into an iterator. In ES6, you can do this by calling the special @@iterator
method. In Fairmont, you can do this by calling iterator
on the value, or simply by passing the value into any function that takes an iterator.
A JavaScript iterator. Iterators have a next
method that yields a product.
Functions that take a producer and transform it into another producer. For example, map
takes a function and a producer and returns another producer that applies the function to the products from the original producer.
An iterator or a reactor. Many Fairmont functions can operate on either, so we say they operate on producers.
A value that can be transformed into a producer. In Fairmont, you can do this by calling producer
on the value, or simply by passing the value into any function that takes an producer.
An object with a done
property and an optional value
property. The done
property indicates whether the source of the product can produce more products. We sometimes use product to refer to a product's value
property, or to a promise that resolves to a product.
An asynchronous iterator. Asynchronous iterators are a proposed standard.
Reactors have a next
method that yields a promise that resolves to a product.
A value that can be transformed into a reactor. In Fairmont, you can do this by calling reactor
on the value, or simply by passing the value into any function that takes an reactor.
A function that takes a producer and transforms it into a non-producer value. For example, reduce
takes a producer and applies a function to each product to generate a final value.