Context

libflitter/Context~ Context

Receptacle for methods and properties that are bound to a particular instance of module:libflitter/app/FlitterApp~FlitterApp. Used to export the functionality of a Unit to the rest of Flitter.

Constructor

new Context(app)

Source:

Initialize the context. Store the module:libflitter/app/FlitterApp~FlitterApp to which items should be bound.

Parameters:
Name Type Description
app module:libflitter/app/FlitterApp~FlitterApp

the Flitter app

Methods

bind(name, handler)

Source:

Store a new method or property in the context. If storing a method, bind the method to module:libflitter/Context~Context#app.

Parameters:
Name Type Description
name string

the name that should be used to access this resource

handler *

method or property to be attached

serialize() → {Proxy}

Source:

Get a Proxy containing the bound methods and properties. This is an unchangeable item which is used to access resources stored in this context.

Returns:
Type
Proxy