Interface: Context

Context

Context represents the context a Concern is created in. With a Context you can:

  • Create Concerns
  • Listen to events via subscribe()
  • more
Source:

Methods

concernOf(factory, name) → {Reference}

concernOf considers a Concern part of this system when it activates.

Parameters:
Name Type Description
factory ConcernFactory
name string
Source:
Returns:
Type
Reference

publish(event)

publish an event. Events are distinguished by the 'name' of their constructor properties.

Parameters:
Name Type Description
event object
Source:

select(path)

select a Concern based on it's path

Parameters:
Name Type Description
path string
Source:

subscribe(event, handler)

subscribe adds a listener for an event

Parameters:
Name Type Description
event object
handler function
Source: