Module
Turbine
- Package
- purescript-turbine
- Repository
- funkia/purescript-turbine
#MapRecord Source
#static Source
static :: forall row c a. RowToList row c => MapRecord c row Behavior () a => Record row -> Record a
A helper function used to convert static values in records into constant behaviors.
Component functions often takes a large amount of behaviors as input. But, sometimes all that is required is static values, that is, constant behaviors. In these cases it can sometimes be tedious to write records like the following:
{ foo: pure 1, bar: pure 2, baz: pure 3, more: pure 4, fields: pure 5 }
The static
function applies pure
to each value in the given record. As
such, the above can be shortened into the following.
static { foo: 1, bar: 2, baz: 3, more: 4, fields: 5 }
#withStatic Source
withStatic :: forall xs p' q' q p o. RowToList p xs => MapRecord xs p Behavior () p' => Union o p' q' => Nub q' q => Record o -> Record p -> Record q
A function closely related to static
. Usefull in cases where a component
function is to be supplied with both a set of static values (constant
behaviors). The function applies static
to its seconds argument and
merges the two records.
It is often used in infix form as in the following example.
{ foo: behA, bar: behB } `withStatic` { baz: 3, more: 4, fields: 5 }
- Modules
- Turbine
- Turbine.
HTML. Elements