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 |
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. |
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 |
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 |
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 |
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. |
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 |
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.
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}. |
Returns:
the callee
- Type
- View
size() → {Number}
Returns the current number of objects the set contains.
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 |
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. |
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. |
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. |
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. |
Returns:
mapped item
- Type
- Object
reduceCallback()
The callback that is invoked when the View changes.
reducer(accumulator, item) → {Object}
The callback that computes the aggregation of the modified View.
Parameters:
Name | Type | Description |
---|---|---|
accumulator |
Object | |
item |
Object |
Returns:
- Type
- Object