LocalContext
Extends:
A local context that will represent the remote context of the other peer.
Constructor Summary
Public Constructor | ||
public |
constructor(session: RemoteSession, parentContext: ReferenceContext, opts: object) |
Member Summary
Public Members | ||
public get |
Get the context remote session |
Method Summary
Public Methods | ||
public |
clear(): * |
|
public |
closure(): * |
|
public |
delete(reference: *): * |
|
public |
destroy(): void Clear the context and destroy the context session only if this context IS NOT created via closure. |
|
public |
Generate a remote action for dispatching the given value remotely. |
|
public |
end(): LocalContext End the remote session. |
|
public |
release(value: *): * |
|
public |
set(reference: *, value: *): * |
Inherited Summary
From class ReferenceContext | ||
public static |
isValidReference(reference: *): boolean Check if the given reference is valid. |
|
public get |
The the number of values in this context including it's parents. |
|
public get |
The the number of values in this context (excluding the parents). |
|
public get |
The the number of keys in this context (excluding the parents). |
|
public get |
Get the parent context. |
|
public get |
The the number of keys in this context including it's parents. |
|
public |
Assign a new reference for the given value or return it's current reference. |
|
public |
clear(): void Clear and release all the values on this context. |
|
public |
Create a closure context for this context. |
|
public |
copyFrom(context: ReferenceContext | Map | Array | object): ReferenceContext Copy from other context it's references and values |
|
public |
Remove the given reference from this context. |
|
public |
Check if this context or one of it's parents has the given value. |
|
public |
forEach(callback: function, thisArg: *): ReferenceContext Iterate over the context own values. |
|
public |
Generate a reference for the |
|
public |
Get the reference value on this context or it's parents. |
|
public |
Check if this context or it's parents has the given reference. |
|
public |
hasOwnReference(reference: Reference): boolean Check if this context only (and not the parents) has the given reference. |
|
public |
Get the reference of the given value in this context or one of it's parents. Return undefined if the value not exists. |
|
public |
Check if this context only (excluding the parents) has the given value. |
|
public |
Release a value from this context and remove any reference for this value. |
|
public |
set(reference: Reference, value: *): ReferenceContext Set a reference for the given value. |
|
public |
Get the instance constructor name. |
From class AssignableContext | ||
public |
generateReference(): * |
Public Constructors
public constructor(session: RemoteSession, parentContext: ReferenceContext, opts: object) source
Create a reference-context instance.
Override:
AssignableContext#constructorParams:
Name | Type | Attribute | Description |
session | RemoteSession | ||
parentContext | ReferenceContext | ||
opts | object | Options for AssignableContext.constructor |
Public Members
Public Methods
public clear(): * source
Clear and release all the values on this context.
Override:
ReferenceContext#clearReturn:
* |
public closure(): * source
Create a closure context for this context.
Override:
ReferenceContext#closureReturn:
* |
public delete(reference: *): * source
Remove the given reference from this context. If the reference exists only on the parent contexts, this method will do nothing.
Override:
ReferenceContext#deleteParams:
Name | Type | Attribute | Description |
reference | * |
Return:
* |
public destroy(): void source
Clear the context and destroy the context session only if this context IS NOT created via closure.
Return:
void |
public dispatch(value: *): Action source
Generate a remote action for dispatching the given value remotely.
Params:
Name | Type | Attribute | Description |
value | * | The given value |
public release(value: *): * source
Release a value from this context and remove any reference for this value. If the value exists on the parent context, this method will do nothing.
Override:
ReferenceContext#releaseParams:
Name | Type | Attribute | Description |
value | * |
Return:
* |
public set(reference: *, value: *): * source
Set a reference for the given value.
Override:
ReferenceContext#setParams:
Name | Type | Attribute | Description |
reference | * | ||
value | * |
Return:
* |