Coder Social home page Coder Social logo

eve's Introduction

eve

Simple Pub/Sub

###Docs

####Add a Listener Eve.on("name of listener", function(params){})

####Emit an Event Eve.emit("name of listener", params)

####Remove a Listener Eve.remove("name of listener", function(params){})

####Remove all Listeners of Same Name Eve.removeAll("name of listener")

####Ignore any Emitter Eve.ignore("name of listener")

To stop ignoring, ignore return an object that contains the until method.
Eve.ignore("name of listener").until("name of another listener")

Example

Eve.ignore("name of listener").until("name of another listener")
Eve.emit("name of listener") // does nothing

Eve.emit("name of another listener") // removes the ignore
Eve.emit("name of listener") // Emits "name of listener"

Note: Eve.observe(name) will also remove the ignore from an emitter

####Defer an Emitter This will prevent an emitter from firing (similar to ignore), until a specified emitter fires first. Eve.defer("name of emitter 1").until("name of emitter 2");

In the above example, "name of emitter 1" will only fire if and when "name of another emitter" is fired.

Note: To remove the deferred state without firing emitter, use the observe method.

####Remove Ignore/Defer from Emitter Eve.observe("name of listener")

This will remove any ignore or pending defer states form an emitter.

####Get info about current Listeners (Dev only) Eve.probeListeners("name of Listener")

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.