new Probe(props, debug)
- Source:
Parameters:
| Name | Type | Description | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object
|
probe options
|
|||||||||||||||||||||||||||
debug |
boolean
|
Members
campaign
- Source:
completeAsync
when status is set to complete or send, the promise will then be resolved
- Source:
data
- Source:
error
- collect all errors in to an array
- no empty error values will be set
- Source:
getStatusAsync
dynamic promise resolver with Simple Q from eaglex.net
- works with
setStatusAsyncsetter/getter - return last 'resolve' status from last
timestampsetting
- Source:
id
- Source:
onchangeDispatch
initiates dispatcher to handle on change value of [data,status,ref,error,campaign]
- Source:
ref
- Source:
ref
- accept string, can only be set when status isnt complete
- can be used to find your Pocket by particular
ref
- Source:
setStatusAsync
- works with
statusAsync - (1.) setter creates our new sq() promise every time, and allows use or resolve
- to use example: setStatusAsync.resolve()
- Source:
setStatusAsync
Resolve text promise and returns last status
memberof Probe
- Source:
status
allow status: open | updated | complete | send | error
open: status is set when pocked is initialized
updated: status is set when data is updated
complete: status is set when you want to complete and discard probe
send: once the status was set complete data is resolved first then status is set as send.
and Probe is locked, cannot be interacted with. Follow the strategic order set by statusStackOrder
error acts like complete, it will resolve() last available data and block the Probe
- Source:
statusStackOrder
forward motion status update is allowed
value: importance que
set: if status already set
- Source:
task
- Source:
Methods
dispatchChange(changedName)
- works with onchangeDispatch, onChange
- emits next value to
onchangeDispatchlistener
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
changedName |
*
|
required, provide name of Probe prop to alert dispatcher what has changed |
Returns:
self
onChange(cb(data,id))
can be used when opts.onChange=true is set
- changes are observed for
[ data,status,ref,error,campaign,status:complete]
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
cb(data,id) |
onChange_cb
|
callback returns updated value in real time |
onComplete(status)
status watch, when current status changes execute send
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
status |
*
|
onOpenStatus(status)
do something on open task, this means we start request for data
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
status |
*
|
update(data:any,, merge:Boolean,)
update
- update data of current Probe{}.data
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
data:any, |
*
|
required |
merge:Boolean, |
*
|
optional for merging object to this.data |