Question

I try to use eventEmitter in my meteor project.

And when I write :

Meteor.require('events');

Nothing happen...

No error and my code after this line doesn't work...

Have you an idea ? thanks you

EDIT

I'm trying to do this :

Deps.autorun(function () {
Meteor.emit('even', Session.get('testok'));
});


var events = Npm.require('events'),


test = new events.EventEmitter;

test.on('even', function (chaine) {
console.log('lol');
console.log(chaine);
});

I try to make an emit when the Session.get('testok') change.

Was it helpful?

Solution

eventEmitter is part of Meteor core, and shouldn't be referenced by your app. Furthermore, there is no Meteor.require.

If you post some of your code and explain what you're trying to accomplish, perhaps the community can be of help.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top