Provides a `typhonjs-core-logging` enabled version of `typhonjs-core-backbone-events`.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
test/src
.babelrc
.esdocrc
.eslintignore
.eslintrc
.gitignore
.npmscriptrc
.travis.yml
AUTHORS.md
CHANGELOG.md
LICENSE
README.md
config.js
gulpfile.babel.js
package.json

README.md

typhonjs-core-backbone-events-logged

Backbone Documentation Code Style License Gitter

Build Status Coverage Dependency Status

Provides a typhonjs-core-logging enabled version of typhonjs-core-backbone-events. Please refer to typhonjs-core-backbone-events documentation for usage details.

TyphonLoggedEvents adds new functionality for triggering events. The following are new trigger mechanisms:

  • triggerDefer - Defers invoking trigger.
  • triggerFirst - Only invokes the first target matched and passes back any result to the callee.
  • triggerResults - Invokes all targets matched and passes back an array of results in an array to the callee.
  • triggerThen - Invokes all targets matched and adds any returned results through Promise.all which returns a single promise to the callee.

mainEventbus.js provides a standardized instance of TyphonLoggedEvents which serves as the name implies as a main eventbus.

Enabling eventbus logging aids debugging. A notable addition to the API is the following methods:

  • setEventScrubber - Sets a function which should accept one parameter which processes the logData object hash which is about to be sent to the logger. This is useful for scrubbing sensitive data such as username / password.
  • setLogLevel - Sets the log level used for logging output.