LatchBond
Extends:
Derivative Bond resolving to a default value when not ready. Once inputBond is ready, its value remains fixed indefinitely.
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Private Members | ||
private |
_notifyId: * |
|
private |
_poll: * |
|
private |
|
|
private |
_targetBond: * |
|
private |
_value: * |
Method Summary
Public Methods | ||
public |
finalise() |
|
public |
|
Inherited Summary
From class Bond | ||
public static |
Create a new Bond which represents the array of many objects' representative values. This object will be ready if and only if all objects in |
|
public static |
instanceOf(b: *): * Duck-typed alternative to |
|
public static |
Create a new Bond which represents a functional transformation of many objects' representative values. |
|
public static |
Create a Promise which represents one or more Bonds. |
|
private static |
_fromSymbol(name: *): * |
|
private static |
_knowSymbol(name: *): * |
|
private |
_defaultTo: * |
|
private |
_mayBeNull: * |
|
private |
|
|
private |
_notifies: {} |
|
private |
_parse: * |
|
private |
|
|
private |
_readyBond: * |
|
private |
_stringify: * |
|
private |
_subscribers: {} |
|
private |
_thens: *[] |
|
private |
_triggering: * |
|
private |
|
|
private |
_uuid: * |
|
private |
_value: * |
|
public |
changed(v: *) Makes the object ready and sets its current value. |
|
public |
Provide a Bond which represents the same as this object except that it takes a particular value when this would be unready. |
|
public |
defaultTo(x: *): * Alters this object so that it is always ready. |
|
public |
done(f: Bond~thenCallback): * Register a function to be called when this object becomes done. |
|
public |
drop() Unregister a single dependency for this object. |
|
public |
Determine if there is a definite value that this object represents at present. |
|
public |
Provide a derivative Bond which represents the same as this object except that before it is ready it evaluates to a given default value and after it becomes ready for the first time it stays fixed to that value indefinitely. |
|
public |
log(): * Logs the current value to the console. |
|
public |
Make a new Bond which is the functional transformation of this object. |
|
public |
Create a new Bond which represents this object's array value with its elements transformed by a function. |
|
public |
mapToString(): * Maps the represented value to a string. |
|
public |
notReady(): * Convenience function for the logical negation of Bond#ready. |
|
public |
Register a function to be called when the value or the readiness changes. |
|
public |
ready(): * Provide a Bond which represents whether this object itself represents a particular value. |
|
public |
Lazily transforms the contents of this object's value when it is an array. This operates on a Bond which should represent an array. It transforms this into a value based on a number of elements at the beginning of that array using a recursive reduce algorithm. The reduce algorithm works around an accumulator model. It begins with
the The Accumulation will continue until either there are no more elements in the array to be processed, or until the early exit flag is true, which ever happens first. |
|
public |
reset() Resets the state of this Bond into being not ready. |
|
public |
Create a new Bond which represents this object's value when subscripted. |
|
public |
subscriptable(depth: number): Proxy Provides a transparently subscriptable version of this object. |
|
public |
then(f: Bond~thenCallback): * Register a function to be called when this object becomes ready. |
|
public |
Register a function to be called when the value changes. |
|
public |
toString(): * |
|
public |
trigger(v: *) Makes the object ready and sets its current value. |
|
public |
Unregister a function previously registered with Bond#notify. |
|
public |
Unregister a function previously registered with Bond#tie. |
|
public |
use(): * Register a single dependency for this object. |
|
public |
Just like |
|
protected |
finalise() Uninitialise the object. |
|
protected |
Initialise the object. |
|
protected |
Returns whether the object is currently in a terminal state. |
Public Constructors
public constructor() source
Constructs a new Bond object whose value is not ready.
Override:
Bond#constructorPublic Methods
public finalise() source
Uninitialise the object.
Will be called at most once after an accompanying Bond#initialise and should close/finalise/drop any resources that are required for the sub-class to maintain its value.
Override:
Bond#finalisepublic initialise() source
Initialise the object.
Will be called at most once before an accompanying Bond#finalise and should initialise/open/create any resources that are required for the sub-class to maintain its value.