Comments (4)
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.
:) 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.
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.
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)
- More docs HOT 5
- emit from server to client/ or vice versa HOT 4
- Why not just use Tracker? HOT 12
- Template.events integration HOT 2
- `this` object in listeners on client should be the EventEmitter object HOT 2
- Client-side "on" and "once" can't be chained. HOT 2
- Server -> Client Events? HOT 2
- basic event
- remove underscore
- Does it also works for Server to Client Event Emitting? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meteor-eventemitter.