918 B

Utilities

Reactimal provides a few utility functions that may be useful when working with its primitives.

id

id(anything) -> anything

id is a function that returns its first parameter. It is used as the default hash function for each subscribable.

call

call(anything) -> void

call will call its first parameter if it is a function otherwise return the parameter. It is used for iterating over dependent inputs of computeds and streams.

pick

pick(propName, default) -> (obj) -> any

pick returns a function that accepts an object and will return the object's property for the provided name or the default if one is supplied. pick is not directly used with any subscribable but can be useful as the computed function when breaking down a prop that contains an object or a container.