Home Reference Source Repository
import Events from 'wyst/es6/utils/Events.js'
public class | source

Events

Static Member Summary

Static Public Members
public static get

the wildcard * event

Static Method Summary

Static Public Methods
public static

generates an evented method name from an event

public static

methodize(klass: *, dict: *)

extends a prototype with an Event Dictionary

public static

namespace(evtMap: Object, ctx: Any): *

adds namespaced event handlers to process.on("message")

Static Public Members

public static get wildcard: string source

the wildcard * event

Static Public Methods

public static methodName(evt: String): String source

generates an evented method name from an event

Params:

NameTypeAttributeDescription
evt String

Return:

String

public static methodize(klass: *, dict: *) source

extends a prototype with an Event Dictionary

Params:

NameTypeAttributeDescription
klass *
dict *

public static namespace(evtMap: Object, ctx: Any): * source

adds namespaced event handlers to process.on("message")

Params:

NameTypeAttributeDescription
evtMap Object

a key, value dictionary of namespaces

ctx Any

the this to apply with a namespace, useful for prototype process listeners

Return:

*

Example:


 process.on('message', 
   namespace({
       job: this.run
     }, this)
  )