Class: View

View

This is the class representing a view.

Constructor

new View()

Source:

Methods

cross(otherView) → {View}

Create a new View containing all elements of the cartesian product of the callee and the argument as Pair.
Parameters:
Name Type Description
otherView View View
Source:
Returns:
Contains every combination of both input Views as two-element Array.
Type
View

delay(delayTime) → {View}

Delays the propagation of items of the callee. Items are propagated to the returned View in View#delay.delayTime milliseconds, if they are not removed from the callee before the timeout.
Parameters:
Name Type Description
delayTime Number the time to delay given in milliSeconds.
Source:
Returns:
Type
View

enter(callback) → {View}

Takes a callback that consumes a single parameter. This callback is called whenever an object is added to the reactive set with that very object.
Parameters:
Name Type Description
callback View~enterCallback this is executed everytime an object is added to the set
Source:
Returns:
The callee of this method.
Type
View

exit(callback) → {View}

Similar to \texttt{enter}, but the callback is called everytime an object is removed from the set.
Parameters:
Name Type Description
callback View~exitCallback
Source:
Returns:
The callee of this method.
Type
View

filter(iterator) → {View}

Takes an additional filter function and returns a reactive object set. That set only contains the objects of the original set that also match the given filter function.
Parameters:
Name Type Description
iterator View~filterIterator
Source:
Returns:
The callee of this method.
Type
View

layer(partialBehavior) → {View}

Define partial behavior attached to each object while it is contained in the set.
Parameters:
Name Type Description
partialBehavior Object the mixin to be applied.
Source:
Returns:
The callee of this method.
Type
View

map(iterator) → {View}

Takes a mapping function and returns another reactive object set. That set always contains the mapped objects corresponding to the objects in the original set.
Parameters:
Name Type Description
iterator View~mapIterator
Source:
Returns:
The callee of this method.
Type
View

now() → {Array}

Returns an Array of the objects that are currently in the set. This Array does not update automatically.
Source:
Returns:
Type
Array

reduce(callback, reducer, initialValue) → {View}

Whenever the callee is modified, this calls the given callback with the reduced value.
Parameters:
Name Type Description
callback View~reduceCallback
reducer View~reducer
initialValue the initial value passed to the {@View~reducer}.
Source:
Returns:
the callee
Type
View

size() → {Number}

Returns the current number of objects the set contains.
Source:
Returns:
Type
Number

union(otherView) → {View}

Create a new View containing all elements of the callee and the argument.
Parameters:
Name Type Description
otherView View View
Source:
Returns:
Contains every object of both input Views.
Type
View

Type Definitions

enterCallback(item)

This callback is call whenever an item is added to this View.
Parameters:
Name Type Description
item Object the item that was just added to the View.
Source:

exitCallback(item)

This callback is call whenever an item is removed from this View.
Parameters:
Name Type Description
item Object the item that was just removed from the View.
Source:

filterIterator(item) → {Boolean}

The callback function called to determine whether an Object is in the derived View.
Parameters:
Name Type Description
item Object item from the original View.
Source:
Returns:
Type
Boolean

mapIterator(item) → {Object}

The callback that computes the item to be added to the mapped View.
Parameters:
Name Type Description
item Object item from the original View.
Source:
Returns:
mapped item
Type
Object

reduceCallback()

The callback that is invoked when the View changes.
Source:

reducer(accumulator, item) → {Object}

The callback that computes the aggregation of the modified View.
Parameters:
Name Type Description
accumulator Object
item Object
Source:
Returns:
Type
Object