Code Monkey home page Code Monkey logo

eventpipe's Introduction

See the file test.js for details on usage

  1. API is the same as node.js' EventEmitter http://nodejs.org/docs/v0.4.2/api/events.html
  2. Drop-In replacement for node.js' EventEmitter except in cases when the listener function returns something or the array returned by the listeners() function is directly manipulated (see conditions 6-9)
  3. Additional 'priority' parameter in addListener (or on) specifies when to call handler
  4. Listeners are called in non-decreasing order of priority (listeners with a lesser numerical priority are called first)
  5. Listeners with the same priority are called in any order
  6. Returning an array or an array-like object will cause that object to be passed on to the next listener
  7. Returning nothing (undefined) causes the arguments to the current listener to be used for the next one
  8. Returning false terminates the piped calling of listeners (the listener returning false will be the last one to be called)
  9. The array returned by listeners() function is not an array of functions. Instead it contains objects of the type { priority: PRIO, proc: PROC }. Please avoid using/manipulaiting it directly. Instead use all the nice functions given to you
  10. All listeners with a given priority may not be called if any one of them returns false

eventpipe's People

Contributors

dhruvbird avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.