Constructor
new DataObserver()
- Source:
creates new DataObserver instance
Members
(private) _observables :Object
- Source:
all observables are listed here
Type:
- Object
(private) _signatures :Object
- Source:
all registered DataSignatures without being subscribed
Type:
- Object
(private) _subscriptions :Map
- Source:
Map with active subscriptions
Type:
- Map
Methods
(private) _addSubscription(origin, key, subscription) → {DataObserver}
- Source:
adds a subscription to the internal subscription storage
Parameters:
Name | Type | Description |
---|---|---|
origin |
ModuleAbstract | unique instance of where this subscription is registered from |
key |
string | |
subscription |
Subscription | RxJs subscription instance |
Returns:
- Type
- DataObserver
(private) _observableExists(key) → {boolean}
- Source:
checks if observable is registered and instanciated by key
Parameters:
Name | Type | Description |
---|---|---|
key |
string |
Returns:
- Type
- boolean
(private) _signatureExists(key) → {boolean}
- Source:
checks if signature exists by key
Parameters:
Name | Type | Description |
---|---|---|
key |
string |
Returns:
- Type
- boolean
addObservable(key, observableModule) → {DataObserver}
- Source:
adds an observable to internalObservable storage
Parameters:
Name | Type | Description |
---|---|---|
key |
string | |
observableModule |
DataAbstract |
Returns:
- Type
- DataObserver
addSignatures(signature) → {DataObserver}
- Source:
registers a signature
Parameters:
Name | Type | Description |
---|---|---|
signature |
DataSignature |
Returns:
- Type
- DataObserver
getSignature(key) → {DataSignature|null}
- Source:
get signature by key
Parameters:
Name | Type | Description |
---|---|---|
key |
string |
Returns:
- Type
- DataSignature | null
getSubscription(origin, key) → {Subscription|null}
- Source:
get single subscription by its origin and data key
Parameters:
Name | Type | Description |
---|---|---|
origin |
ModuleAbstract | |
key |
string |
Returns:
- Type
- Subscription | null
getSubscriptions(origin) → {Set}
- Source:
get a set of subscriptions by its origin
Parameters:
Name | Type | Description |
---|---|---|
origin |
ModuleAbstract |
Returns:
- Type
- Set
isSignatureBusy(key) → {boolean}
- Source:
checks if signature isBusy
Parameters:
Name | Type | Description |
---|---|---|
key |
Returns:
- Type
- boolean
pushTo(key, message)
- Source:
Push data to a Data instance
Parameters:
Name | Type | Description |
---|---|---|
key |
DataSignature.key | DataSignature.key |
message |
Message |
removeObservable(key) → {DataObserver}
- Source:
deletes an stored observable by key
Parameters:
Name | Type | Description |
---|---|---|
key |
string |
Returns:
- Type
- DataObserver
removeSignature(signature) → {DataObserver}
- Source:
remove signature
Parameters:
Name | Type | Description |
---|---|---|
signature |
DataSignature |
Returns:
- Type
- DataObserver
setSignatureBusy(key) → {DataObserver}
- Source:
sets busy state to true for a given signature while instanciating. Avoids multi instanciating same DataPool
Parameters:
Name | Type | Description |
---|---|---|
key |
string |
Returns:
- Type
- DataObserver
subscribe(origin, to, next, error, complete, filter)
- Source:
adds a subscription to a registered Data pool by its key
Parameters:
Name | Type | Default | Description |
---|---|---|---|
origin |
ModuleAbstract | unique instance of the subscribers scope |
|
to |
DataSignature.key | DataSignature.key |
|
next |
function | object | callback function on next item or objects with action props |
|
error |
function | callback function on error |
|
complete |
function | callback function on complete queue |
|
filter |
function |
null
|
filter messages by |
subscriptionExists(origin, key) → {boolean}
- Source:
checks if a certain subscription exists for its origin
Parameters:
Name | Type | Description |
---|---|---|
origin |
ModuleAbstract | |
key |
string |
Returns:
- Type
- boolean
unsubscribe(origin, from) → {DataObserver}
- Source:
unsubscribe from subscription by origin and optionally key
Parameters:
Name | Type | Default | Description |
---|---|---|---|
origin |
ModuleAbstract | ||
from |
DataSignature.key |
null
|
DataSignature.key |
Returns:
- Type
- DataObserver
unsubscribeAll(origin) → {DataObserver}
- Source:
unsubscribe all subscription of a given origin
Parameters:
Name | Type | Description |
---|---|---|
origin |
ModuleAbstract |
Returns:
- Type
- DataObserver
unsubscribeFrom(origin, key) → {DataObserver}
- Source:
unsubscribe form a certain DataPool by origin and key
Parameters:
Name | Type | Description |
---|---|---|
origin |
ModuleAbstract | |
key |
string |
Returns:
- Type
- DataObserver