GithubHelp home page GithubHelp logo

Comments (4)

arunoda avatar arunoda commented on May 29, 2024

I'm not familiar with cordova and frankly didn't get what you've said.
How about some code example?

On Mon, Mar 16, 2015 at 2:58 PM Morten N.O. Nørgaard Henriksen <
[email protected]> wrote:

We lack an emitter to simulate a state an example could be the cordova
ready event where we want to be notified when a state changes, if a state
is already set we will run the listener at registration.

Another use case is for the raix:push package where a push message can be
set before Meteor is even ready/after ready etc. So the message can be
interpreted as a state, eg. we want to get the state and updates.

cc: @arunoda https://github.com/arunoda (If you have input or opinion
about this)


Reply to this email directly or view it on GitHub
#9.

from meteor-eventemitter.

raix avatar raix commented on May 29, 2024

:) fair enough

  var em = new EventEmitter();


  em.addListener('ready', function() {
    // I'm waiting on the ready state
  });

  // Emit a ready state - additional data is optional
  em.emitState('ready');

  em.addListener('ready', function() {
    // I'll just run since the ready state is already triggered
  });  

from meteor-eventemitter.

arunoda avatar arunoda commented on May 29, 2024

Okay. got it.
Then I think, it's better we build it as a separate package.

I know, it can be useful for a lot of places. For example, when creating
ready callbacks and so on.

May be you can use this package behind the scene.

On Mon, Mar 16, 2015 at 3:03 PM Morten N.O. Nørgaard Henriksen <
[email protected]> wrote:

:) fair enough

var em = new EventEmitter();

em.addListener('ready', function() {
// I'm waiting on the ready state
});

// Emit a ready state - additional data is optional
em.emitState('ready');

em.addListener('ready', function() {
// I'll just run since the ready state is already triggered
});


Reply to this email directly or view it on GitHub
#9 (comment)
.

from meteor-eventemitter.

raix avatar raix commented on May 29, 2024

yep, good point - might be best to keep this package as clean as possible - maybe I'll add a eventState package instead, thanks!

from meteor-eventemitter.

Related Issues (11)

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.