FTN15: Native Event API
Version: 1.1
Date: 2017-12-26
Copyright: 2015-2017 FutoIn Project (http://futoin.org)
Authors: Andrey Galkin


1. Concept

There is nothing new in this specification, but a formalization for referencing of a well known API pattern in JavaScript world.

Any object may have on(), off(), once() and emit() methods to register event handler, unregister event handler, register event handler to catch only once and emit events.

Event handler must get executed with no emit() call in function stack.

Allowed event name list must be provided during initialization. Public API must fail on unknown event, if applicable.

There should be soft control of max listeners per event and implementation-defined warning when limit is reached.

All manipulations of EventEmitter settings should be done through API which is not exposed through target object.

2. Native API