Header menu logo Sutil

Bind Type

Bindings for observables and the Core. For example, use an IObservable<bool> to toggle an element's class attribute

Static members

Static member Description

Bind.attr (name, dispatch)

Full Usage: Bind.attr (name, dispatch)

Parameters:
    name : string
    dispatch : 'T -> unit

Returns: SutilElement

One-way binding from attribute to dispatch function

name : string
dispatch : 'T -> unit
Returns: SutilElement

Bind.attr (name, value)

Full Usage: Bind.attr (name, value)

Parameters:
Returns: SutilElement

One-way binding from value to attribute. Note that passing store to this function will select the more specific `attr<'T>( string, IStore<'T>)` overload. If that looks to be a problem, we'll rename both of them to force a considered choice.

name : string
value : IObservable<'T>
Returns: SutilElement

Bind.attr (name, value)

Full Usage: Bind.attr (name, value)

Parameters:
    name : string
    value : IStore<'T>

Returns: SutilElement

Dual-binding for a given attribute. Changes to value are written to the attribute, while changes to the attribute are written back to the store. Note that an IStore is also an IObservable, for which a separate overload exists.

name : string
value : IStore<'T>
Returns: SutilElement

Bind.attr (name, value, dispatch)

Full Usage: Bind.attr (name, value, dispatch)

Parameters:
    name : string
    value : IObservable<'T>
    dispatch : 'T -> unit

Returns: SutilElement

Two-way binding from value to attribute and from attribute to dispatch function

name : string
value : IObservable<'T>
dispatch : 'T -> unit
Returns: SutilElement

Bind.attrInit (attrName, initValue, dispatch)

Full Usage: Bind.attrInit (attrName, initValue, dispatch)

Parameters:
    attrName : string
    initValue : 'T
    dispatch : 'T -> unit

Returns: SutilElement

Bind a scalar value to an element attribute. Listen for onchange events and dispatch the attribute's current value to the given function. This form is useful for view templates where v is invariant (for example, an each that already filters on the value of v, like Todo.Done)

attrName : string
initValue : 'T
dispatch : 'T -> unit
Returns: SutilElement

Bind.booleanAttr (name, isTrue)

Full Usage: Bind.booleanAttr (name, isTrue)

Parameters:
Returns: SutilElement
name : string
isTrue : IObservable<bool>
Returns: SutilElement

Bind.checkboxGroup store

Full Usage: Bind.checkboxGroup store

Parameters:
    store : Store<string list>

Returns: SutilElement

For multiple input elements. The input elements are grouped explicitly by name, or will be implicitly grouped by the (internal) name of the binding store. Each checkbox in the group is checked if its value is contained in the current string list

store : Store<string list>
Returns: SutilElement

Bind.className name

Full Usage: Bind.className name

Parameters:
Returns: SutilElement
name : IObservable<string>
Returns: SutilElement

Bind.classNames name

Full Usage: Bind.classNames name

Parameters:
Returns: SutilElement
name : IObservable<'a>
Returns: SutilElement

Bind.each (items, view, key)

Full Usage: Bind.each (items, view, key)

Parameters:
Returns: SutilElement
items : IObservable<'T list>
view : IReadOnlyStore<'T> -> SutilElement
key : 'T -> 'K
Returns: SutilElement

Bind.each (items, view, key)

Full Usage: Bind.each (items, view, key)

Parameters:
Returns: SutilElement

Bind keyed lists to a simple template, with transitions

items : IObservable<'T list>
view : IObservable<'T> -> SutilElement
key : 'T -> 'K
Returns: SutilElement

Bind.each (items, view, key, trans)

Full Usage: Bind.each (items, view, key, trans)

Parameters:
Returns: SutilElement

Bind keyed lists to a simple template, with transitions

items : IObservable<'T list>
view : IObservable<'T> -> SutilElement
key : 'T -> 'K
trans : TransitionAttribute list
Returns: SutilElement

Bind.each (items, view, key)

Full Usage: Bind.each (items, view, key)

Parameters:
Returns: SutilElement

Bind keyed lists to a simple template Deprecated: Use a view template that takes IObservable<'T>

items : IObservable<'T list>
view : 'T -> SutilElement
key : 'T -> 'K
Returns: SutilElement

Bind.each (items, view, key, trans)

Full Usage: Bind.each (items, view, key, trans)

Parameters:
Returns: SutilElement

Bind keyed lists to a simple template, with transitions Deprecated: Use a view template that takes IObservable<'T>

items : IObservable<'T list>
view : 'T -> SutilElement
key : 'T -> 'K
trans : TransitionAttribute list
Returns: SutilElement

Bind.each (items, view)

Full Usage: Bind.each (items, view)

Parameters:
Returns: SutilElement

Bind lists to a simple template

items : IObservable<'T list>
view : 'T -> SutilElement
Returns: SutilElement

Bind.each (items, view, trans)

Full Usage: Bind.each (items, view, trans)

Parameters:
Returns: SutilElement

Bind lists to a simple template, with transitions

items : IObservable<'T list>
view : 'T -> SutilElement
trans : TransitionAttribute list
Returns: SutilElement

Bind.eachi (items, view, key)

Full Usage: Bind.eachi (items, view, key)

Parameters:
Returns: SutilElement
items : IObservable<'T list>
view : IObservable<int> * IObservable<'T> -> SutilElement
key : int * 'T -> 'K
Returns: SutilElement

Bind.eachi (items, view, key, trans)

Full Usage: Bind.eachi (items, view, key, trans)

Parameters:
Returns: SutilElement
items : IObservable<'T list>
view : IObservable<int> * IObservable<'T> -> SutilElement
key : int * 'T -> 'K
trans : TransitionAttribute list
Returns: SutilElement

Bind.eachi (items, view)

Full Usage: Bind.eachi (items, view)

Parameters:
Returns: SutilElement
items : IObservable<'T list>
view : IObservable<int> * IObservable<'T> -> SutilElement
Returns: SutilElement

Bind.eachi (items, view, trans)

Full Usage: Bind.eachi (items, view, trans)

Parameters:
Returns: SutilElement
items : IObservable<'T list>
view : IObservable<int> * IObservable<'T> -> SutilElement
trans : TransitionAttribute list
Returns: SutilElement

Bind.eachi (items, view)

Full Usage: Bind.eachi (items, view)

Parameters:
Returns: SutilElement
items : IObservable<'T list>
view : int * 'T -> SutilElement
Returns: SutilElement

Bind.eachi (items, view, trans)

Full Usage: Bind.eachi (items, view, trans)

Parameters:
Returns: SutilElement
items : IObservable<'T list>
view : int * 'T -> SutilElement
trans : TransitionAttribute list
Returns: SutilElement

Bind.effect (values, updater)

Full Usage: Bind.effect (values, updater)

Parameters:
Returns: SutilElement
values : IObservable<'T>
updater : 'E -> 'T -> unit
Returns: SutilElement

Bind.el (value, key, element)

Full Usage: Bind.el (value, key, element)

Parameters:
Returns: SutilElement
value : IObservable<'T>
key : 'T -> 'K
element : IObservable<'T> -> SutilElement
Returns: SutilElement

Bind.el (value, key, element)

Full Usage: Bind.el (value, key, element)

Parameters:
Returns: SutilElement
value : IObservable<'T>
key : 'T -> 'K
element : 'T -> SutilElement
Returns: SutilElement

Bind.el (value, element)

Full Usage: Bind.el (value, element)

Parameters:
Returns: SutilElement

Binding from value to a DOM fragment. Each change in value replaces the current DOM fragment with a new one.

value : IObservable<'T>
element : 'T -> SutilElement
Returns: SutilElement

Bind.el2 valueA valueB element

Full Usage: Bind.el2 valueA valueB element

Parameters:
Returns: SutilElement

Binding from two values to a DOM fragment. See fragment<'T>

valueA : IObservable<'A>
valueB : IObservable<'B>
element : 'A * 'B -> SutilElement
Returns: SutilElement

Bind.fragment value element

Full Usage: Bind.fragment value element

Parameters:
Returns: SutilElement

Deprecated naming, use Bind.el

value : IObservable<'T>
element : 'T -> SutilElement
Returns: SutilElement

Bind.fragment2 valueA valueB element

Full Usage: Bind.fragment2 valueA valueB element

Parameters:
Returns: SutilElement

Deprecated naming, use Bind.el

valueA : IObservable<'A>
valueB : IObservable<'B>
element : 'A * 'B -> SutilElement
Returns: SutilElement

Bind.leftTop xy

Full Usage: Bind.leftTop xy

Parameters:
Returns: SutilElement
xy : IObservable<float * float>
Returns: SutilElement

Bind.promise (p, view)

Full Usage: Bind.promise (p, view)

Parameters:
Returns: SutilElement
p : Promise<'T>
view : 'T -> SutilElement
Returns: SutilElement

Bind.promise (p, view, waiting, error)

Full Usage: Bind.promise (p, view, waiting, error)

Parameters:
Returns: SutilElement
p : Promise<'T>
view : 'T -> SutilElement
waiting : SutilElement
error : Exception -> SutilElement
Returns: SutilElement

Bind.promises (items, view, waiting, error)

Full Usage: Bind.promises (items, view, waiting, error)

Parameters:
Returns: SutilElement
items : IObservable<Promise<'T>>
view : 'T -> SutilElement
waiting : SutilElement
error : Exception -> SutilElement
Returns: SutilElement

Bind.radioValue store

Full Usage: Bind.radioValue store

Parameters:
Returns: SutilElement

For input[type='radio'] Only the checkbox with store's current value will be checked at any one time.

store : Store<'T>
Returns: SutilElement

Bind.selectMultiple (value, dispatch)

Full Usage: Bind.selectMultiple (value, dispatch)

Parameters:
    value : IObservable<'T list>
    dispatch : 'T list -> unit

Returns: SutilElement
value : IObservable<'T list>
dispatch : 'T list -> unit
Returns: SutilElement

Bind.selectMultiple store

Full Usage: Bind.selectMultiple store

Parameters:
Returns: SutilElement
store : IStore<'T list>
Returns: SutilElement

Bind.selectOptional store

Full Usage: Bind.selectOptional store

Parameters:
    store : Store<'T option>

Returns: SutilElement
store : Store<'T option>
Returns: SutilElement

Bind.selectSingle (value, dispatch)

Full Usage: Bind.selectSingle (value, dispatch)

Parameters:
Returns: SutilElement
value : IObservable<'T>
dispatch : 'T -> unit
Returns: SutilElement

Bind.selectSingle store

Full Usage: Bind.selectSingle store

Parameters:
Returns: SutilElement
store : Store<'T>
Returns: SutilElement

Bind.selected store

Full Usage: Bind.selected store

Parameters:
Returns: SutilElement
store : IStore<'T>
Returns: SutilElement

Bind.selected store

Full Usage: Bind.selected store

Parameters:
Returns: SutilElement
store : IStore<'T option>
Returns: SutilElement

Bind.selected store

Full Usage: Bind.selected store

Parameters:
Returns: SutilElement
store : IStore<'T list>
Returns: SutilElement

Bind.selected (value, dispatch)

Full Usage: Bind.selected (value, dispatch)

Parameters:
    value : IObservable<'T list>
    dispatch : 'T list -> unit

Returns: SutilElement
value : IObservable<'T list>
dispatch : 'T list -> unit
Returns: SutilElement

Bind.style (values, updater)

Full Usage: Bind.style (values, updater)

Parameters:
Returns: SutilElement

One way binding from custom values to style updater function. This allows updating of the element's style property rather than the style attribute string.

values : IObservable<'T>
updater : CSSStyleDeclaration -> 'T -> unit
Returns: SutilElement

Bind.style attrs

Full Usage: Bind.style attrs

Parameters:
Returns: SutilElement

One way binding from style values into style attribute

attrs : IObservable<'a>
Returns: SutilElement

Bind.toggleClass (toggle, activeClass)

Full Usage: Bind.toggleClass (toggle, activeClass)

Parameters:
Returns: SutilElement
toggle : IObservable<bool>
activeClass : string
Returns: SutilElement

Bind.toggleClass (toggle, activeClass, inactiveClass)

Full Usage: Bind.toggleClass (toggle, activeClass, inactiveClass)

Parameters:
    toggle : IObservable<bool>
    activeClass : string
    inactiveClass : string

Returns: SutilElement
toggle : IObservable<bool>
activeClass : string
inactiveClass : string
Returns: SutilElement

Bind.visibility (isVisible, trans)

Full Usage: Bind.visibility (isVisible, trans)

Parameters:
Returns: SutilElement -> SutilElement
isVisible : IObservable<bool>
trans : TransitionAttribute list
Returns: SutilElement -> SutilElement

Bind.visibility isVisible

Full Usage: Bind.visibility isVisible

Parameters:
Returns: SutilElement -> SutilElement
isVisible : IObservable<bool>
Returns: SutilElement -> SutilElement

Bind.widthHeight xy

Full Usage: Bind.widthHeight xy

Parameters:
Returns: SutilElement
xy : IObservable<float * float>
Returns: SutilElement

Type something to start searching.