- If ⇒
ForkPromiseProxy
Async conditions
- List(list) ⇒
ListHandler
takes a list and returns a List handler instance
- async(fn) ⇒
function
Takes a function and returns an async version of it
- threaded(fn) ⇒
Promise
takes a function, spawns a webworker and executes that function inside the webworker
Kind: global class
Proxy class for handling promises
When the promise resolves it should call this method to handle the if else statements
Kind: instance method of ForkPromiseProxy
Param | Type | Description |
---|---|---|
type | String |
'then' or 'else' types |
forkPromiseProxy.then(handle) ⇒ ForkPromiseProxy
sets the handle function for a true conditions
Kind: instance method of ForkPromiseProxy
Param | Type |
---|---|
handle | function |
forkPromiseProxy.else(handle) ⇒ ForkPromiseProxy
sets the handle function for a false condition
Kind: instance method of ForkPromiseProxy
Param | Type |
---|---|
handle | function |
Kind: global class
- ListHandler
- new ListHandler(list)
- .filter(condition) ⇒
Promise
- .each(handle) ⇒
Promise
- .map(handle) ⇒
Promise
- .find(condition) ⇒
Promise
Async array usage
Param | Type |
---|---|
list | Array |
Filter an array and return a new array with the filtered values
Kind: instance method of ListHandler
Param | Type |
---|---|
condition | function |
Iterate thru a list
Kind: instance method of ListHandler
Param | Type |
---|---|
handle | function |
Itarate thru the list and create a new array with augmentet values
Kind: instance method of ListHandler
Param | Type |
---|---|
handle | function |
Find a specific elemnet inside a list
Kind: instance method of ListHandler
Param | Type |
---|---|
condition | function |
Kind: global class
- Loop
- new Loop(handle, iterations)
- instance
- static
- .until(handle, iterations) ⇒
Promise
- .unique(id) ⇒
Object
- .until(handle, iterations) ⇒
Async loop class that takes a handle as a parameter and a maximum number of iterations
Param | Type |
---|---|
handle | function |
iterations | Number |
Starts the loop
Kind: instance method of Loop
stops the loop normally
Kind: instance method of Loop
Interupt the loop with a type and message. This will call the reject callback on the promise.
Kind: instance method of Loop
Param | Type |
---|---|
type | String |
message | String |
Cancel the loop and provide a reason message
Kind: instance method of Loop
Param | Type |
---|---|
message | String |
Kill the loop and provide a reason message
Kind: instance method of Loop
Param | Type |
---|---|
message | String |
Loop until the handle function returns true
Kind: static method of Loop
Param | Type |
---|---|
handle | function |
iterations | Number |
Creates a unique loop task that will terminate when another task with the same id starts
Kind: static method of Loop
Param | Type |
---|---|
id | String |
Kind: global class
Helper class that will run a function in a separate thread by using webworkers
Param | Type |
---|---|
handle | function |
Execute the function
Kind: instance method of Thread
Param | Type | Description |
---|---|---|
params | Array |
function arguments |
Start the thread. Creates a new webworker
Kind: instance method of Thread
terminates the thread and worker
Kind: instance method of Thread
If ⇒ ForkPromiseProxy
Async conditions
Kind: global variable
Param | Type |
---|---|
condition | function |
List(list) ⇒ ListHandler
takes a list and returns a List handler instance
Kind: global function
Param | Type |
---|---|
list | Array |
Takes a function and returns an async version of it
Kind: global function
Param | Type |
---|---|
fn | function |
takes a function, spawns a webworker and executes that function inside the webworker
Kind: global function
Param | Type |
---|---|
fn | function |