Module: animate

`animate` functions manipulate a state object according to the inputs t, state, begin, end. As an animation steps it will call its animate function with a progressing `t` value commonly being the number of seconds divided by the duration of the animation. t is a time interval unit ranging from values 0 to 1.
Source:
Example
// Return the value for this function at point t (0 to 1) with the input
// state, begin, end. If state is an object the value can be set directly
// to a member of state. The update function will ensure that state, begin,
// and end, have the same shape and are defined.
function f(t, state, begin, end) {}
// Return the value for this function optionally considering function b to
// be the target destination at t = 1. Think of this function as from `a`
// to `b`.
f.a = function(b, t, state, begin, end) {}
// Return true if state has reached what this function considers to be the
// end. Some functions may think that is t >= 1. Some functions may think
// that is state === end.
f.eq = function(t, state, begin, end) {}

Methods

(inner) a()

Create a function with the output of another animate call and a a-to-b function to replace the a-to-b from the other animate call.
Source:

(inner) abs()

Create a function that returns the absolute value of the returned result of the passed function.
Source:

(inner) add()

Create a function that returns the sumed value of the returned results of the two passed functions.
Source:

(inner) array()

Create a function that calls the given function with every indexed member of state, begin, and end.
Source:

(inner) at()

Create a function that passes a value between the begin and end value based on the given position (pos) value. A 0 position value is the begin value. A 1 position value is the end value. Any value between 0 and 1 is proprotionally positioned on the line between begin and end.
Source:

(inner) begin()

Create a function that returns the begin value.
Source:

(inner) constant()

Create a function that returns the given constant value.
Source:

(inner) div()

Create a function that returns the divided value of the returned results of the two passed functions.
Source:

(inner) done()

Create a function with the output of another animate call and an eq when-animate-is-complete function to replace the eq from the other animate call.
Source:

(inner) duration()

Create a function that calls the passed function with t transformed by dividing t by a given constant duration.
Source:

(inner) easeIn()

Create a function that calls the passed function with t transformed by a cubic ease-in function.
Source:

(inner) easeInOut()

Create a function that calls the passed function with t transformed by a cubic ease-in-out function.
Source:

(inner) easeOut()

Create a function that calls the passed function with t transformed by a cubic ease-out function.
Source:

(inner) easing()

Create a function that transforms t by one function and passing that into the first function along with state, begin, and end.
Source:

(inner) end()

Create a function that returns the end value.
Source:

(inner) eq()

Create a function that returns whether the returned results of the two passed functions are equivalent.
Source:

(inner) get()

Create a function that calls the passed second argument with the key member of the state, begin, and end values.
Source:

(inner) gt()

Create a function that returns whether the returned result of the first passed functions is greater than the second passed function's result.
Source:

(inner) gte()

Create a function that returns whether the returned result of the first passed functions is greater than or equal to the second passed function's result.
Source:

(inner) lerp()

Create an animate function that calls the passed function and returns the result. It's a-to-b method calls the passed function and the b and interpolates between them depending on `t`.
Source:

(inner) loop()

Creates a function that calls the passed function with t transformed by using its remainder divided by a constant value.
Source:

(inner) lt()

Create a function that returns whether the returned result of the first passed functions is less than the second passed function's result.
Source:

(inner) lte()

Create a function that returns whether the returned result of the first passed functions is less than or equal to the second passed function's result.
Source:

(inner) max()

Create a function that returns the maximum value of the returned results of the two passed functions.
Source:

(inner) min()

Create a function that returns the minimum value of the returned results of the two passed functions.
Source:

(inner) mod()

Create a function that returns the remainder of the divided of the returned results of the two passed functions.
Source:

(inner) mul()

Create a function that returns the multiplied value of the returned results of the two passed functions.
Source:

(inner) ne()

Create a function that returns whether the returned results of the two passed functions are different.
Source:

(inner) object()

Create a function that iterates the given object's keys and values, setting the state's key member by the called value function given the key member of state, begin, and end.
Source:

(inner) repeat()

Creates a function that calls the passed function with until the until function returns a value greater or than 1.
Source:

(inner) set()

Create a function that sets the key's member of the state value with the result of the called function.
Source:

(inner) state()

Create a function that returns the passed state value.
Source:

(inner) sub()

Create a function that returns the difference of the returned results of the two passed functions.
Source:

(inner) t()

Create a function that returns the passed t value.
Source:

(inner) to()

Create a function that returns the value portionally based on t between the first and second function in the passed array.
Source:

(inner) union()

Create an animate function that calls each function in the given array with the same t, state, begin, and end values. This is useful to perform different behaviours on the same object in the state's shape.
Source:

(inner) value()

Create an animate function that calls the passed function argument with t, state, begin, and end return its result.
Source: