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

result() method from fcf.Actions class

mixed result()
fcf.Actions result(mixed a_value)

Package: fcf-framework-core

File: fcf-framework-core:fcf.js

Available from version: 2.0.2

Gets or sets the result of executing an object depending on the arguments passed

If the a_value argument is passed to the function, then the function sets a new value for the result of performing asynchronous operations.

If the function is called with no arguments, it returns the currently set result of the asynchronous operations.

Arguments

mixed a_value
- A new set value for the result of asynchronous operations
Result
mixed|fcf.Actinons
- If an argument a_value is passed, then a pointer to itself.

If the function is called without arguments, then the current value of the result of performing asynchronous operations is returned.

Example: Get value

let actions = new fcf.Actions(); actions.then(()=>{ return "Result value"; }); console.log(actions.result());

Output:

Result value

Example: Set value

let actions = new fcf.Actions(); actions.result("Result value"); actions.then((a_lastResutl)=>{ console.log(a_lastResutl); });

Output:

Result value