constructor() method from fcf.Actions class
Package: fcf-framework-core
File: fcf-framework-core:fcf.js
Available from version: 2.0.2
Constructor
-
boolean deferred =false - If the flag istrue , then the added callbacks will not be executed until thefcf.Actions.startup () method is called. -
boolean noexcept =false - If the flag istrue , then when the callback ends with an error, the queue is not stopped and the handlers passed tocatch are not called. -
mixed errorResult =undefined - The result returned by theresult () method in case of an error -
boolean quiet =false - Iftrue , no raw error messages are printed to the console.
A handler function can have two formats:
-
mixed a_cb() - Format without confirmation of completion of the operation. The function can be asynchronous. The result returned by the function will be passed to the next handler.let
actions = new fcf.Actions(()=>{ return "hello" });actions .then ((a_result)=>{ console.log(a_result); });Output:
hello -
mixed a_cb(fcf.Actions.Act a_act) - Format with confirmation of completion of the operation. To complete an asynchronous operation, the handler function must call thefcf.Actions.Act.complete () method orfcf.Actions.Act.error () on an error. The result passed to thefcf.Actions.Act.complete () function call will be passed to the next handler.let
actions = new fcf.Actions((a_act )=>{ setTimeout(()=>{a_act .complete ("hello"); }, 1000) });actions .then ((a_result)=>{ console.log(a_result); });Output:
hello