FCF 2.0 development in progress...
> > > > > >
[News] [Packages API] [Downloads] [Donate to the project] [Contacts]

options() method from fcf.Actions class

fcf.Actions options({deferred, noexcept, errorResult, quiet} a_options)
{deferred, noexcept, errorResult, quiet} options()

Package: fcf-framework-core

File: fcf-framework-core:fcf.js

Available from version: 2.0.2

Sets or gets the parameters of the pending action object, depending on the parameters passed.

Arguments

{deferred, noexcept, errorResult, quiet} a_options
- Object options, if the option is not set, then it does not change:
  • boolean deferred If the flag is true, then the added callbacks will not be execute until the fcf.Actions.startup() method is called.

  • boolean noexcept If the flag is true, then if the callback ends with an error, the queue execution is not stopped and the handlers passed to catch are not called.

  • mixed errorResult The result returned by the result() method in case of an error

  • boolean quiet If true, then raw error messages are not printed to the console.

Result
fcf.Actions|{deferred, noexcept, errorResult, quiet}
- If the a_options argument is given, then the function returns a pointer to itself.

If the function is called without arguments, then an object is returned containing the current state of the object's options.

Example: Set value

fcf.actions() .options({noexcept: true}) .then(()=>{ console.log("First action"); throw new Error("Test error"); }) .then((a_lastResult)=>{ console.log("Second action"); })

Output:

First action Second action

Example: Get value

let actions = new fcf.Actions(); console.log(let actions.options().noexcept);

Output:

false