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

"update_after" event of base class fcf.EventEmitter (class fcf.Configuration)

Event: update_after

Package: fcf-framework-core

Available from version: 2.0.2

Called when the configuration is updated after changes have been made.

Event arguments
{objects, configuration} a_event
- The event contains the following fields
  • object object - Added object with configuration parameters

  • fcf.Configuration configuration - Self pointer

Example: Application

let configuration = new fcf.Configuration(); configuration.on("update_before", (a_event)=>{ if ("number" in a_event.object) { a_event.object.number = parseInt(a_event.object.number); if (isNaN(a_event.object.number)) { throw new Error("Incorrect type"); } } }); configuration.append({number: "1"}); console.log("value:", configuration.number, "; type:", typeof configuration.number);

Output:

value: 1 ; type: number