Questions tagged [eventemitter]

An event emitter is a platform for triggering and listening for events.

An event emitter is a platform for triggering and listening for events. Different libraries offer different implementations and for different purposes.

960 questions
0
votes
1 answer

Angular2 eventEmitter, parent wont catch it

Have used quite some time now, trying to find out why the parent does not receive the event and call the function. Have a parent app (called AppComponent) and the child component (called HomeComponent) HomeComponent.ts @Component({ selector:…
Mikkel
  • 1,771
  • 11
  • 35
  • 59
0
votes
0 answers

viewComponentRef and component factory used for rendering controls in angular 2 reference

I created some custom control and render a json of form attributes using the component factory and view resolver. Same approach as below. Query.Add instead of Dynamic Component Loader (loadintolocation) In custom controls I am emitting a…
0
votes
1 answer

Angular2 EventEmitter does not complete after invoking .error

I have an EventEmitter that inform a user that notify a component that the state of the application has changed. This event inform whether a user who is trying to authenticate has been successful. private emitAuthStatus(success: boolean) { if…
Linvi
  • 2,077
  • 1
  • 14
  • 28
0
votes
1 answer

EventEmitter Ignore next listeners if conditions are true

I'm creating a Telegram bot which uses node-telegram-bot-api package. That package uses EventEmitter3 for emitting events. I have a listener that executes before all other listeners: Bot.prependListener( 'message', ( msg ) => if ( CHECK…
Ehsaan
  • 109
  • 1
  • 6
0
votes
3 answers

Angular 2 and EventEmitter

Hello I've started studying Angular 2. Maybe someone could help me with my question about EventEmitter and outputs in Angular 2 I have 3 components. AppComponent is parent of CountriesListComponent. CountriesListComponent is parent of…
Egor
  • 2,122
  • 2
  • 21
  • 23
0
votes
0 answers

NodeJS EventEmiter not emiting the event

I just wonder if the following code is supposed to work: // my-class.js const EventEmmiter = require('events') class MyClass extends EventEmmiter { constructor () { super() } trigger () { console.log('trigger') …
Andrei Stalbe
  • 1,511
  • 6
  • 26
  • 44
0
votes
1 answer

Eventemitter and nexttick in nodejs

I'm confused about Eventemitter. I write a code but that does not work properly. Why the below code does not work : const EventEmitter = require('events'); const util = require('util'); function MyEmitter() { EventEmitter.call(this); …
metis
  • 1,024
  • 2
  • 10
  • 26
0
votes
1 answer

Derived node.js EventEmitter will call the wrong listener when in a named object property

I've been working on creating my own home automation hub using a handful of node.js packages (Express, mqtt, socket.io) with a MongoDB database and Angular running in the client. This project is the first time I've worked with any JavaScript, so…
0
votes
1 answer

Node.JS: Event Emmiter

function Auth() { console.log('Created!') } Auth.prototype.authenticate = function () { // do stuff this.emit('completed') } util.inherits(Auth, EventEmitter) How can i call Auth.emit('someEvent') in other functions? For example: function…
Src
  • 5,252
  • 5
  • 28
  • 56
0
votes
1 answer

nodejs Websocket Server - possible EventEmitter memory leak detected

I'm relatively new to node and im struggling to find the answers! I've created a very basic node script that is used to connect to a rs232 serial device, at the same time it serves as a websocket server so that clients can connect to it to get live…
0
votes
1 answer

Cannot remove dynamic event listeners

When using a regular function to bind to an event, I can remove it without problems. But when using a dynamic list of context functions, I cannot remove listeners for those. Here's a simplified version of an entire test application: 'use…
vitaly-t
  • 24,279
  • 15
  • 116
  • 138
0
votes
0 answers

Test when eventEmitter subscription has finished

I have a function like: public openCamera = (obj) => { this._nativeCamera.getPicture() .subscribe((selectedImage) => { obj.avatar = selectedImage; }); }; Now I want to test this function. it('should pass', function(){ …
masimplo
  • 3,674
  • 2
  • 30
  • 47
0
votes
1 answer

Error: ETIMEDOUT on NPM usage in Meteor

I try to use this NPM packages in Meteor 1.3.2.4. It use eventemitter in functions and has asyncronous callbacks. I try to convert it to synchronous-looking with Meteor.bindEnvironment based on this guide article like below: Meteor.methods({ …
b24
  • 2,425
  • 6
  • 30
  • 51
0
votes
1 answer

Can't understand what's going on with EventEmitter using webpack and es6 modules

I'm trying to learn webpack and es6 at the same time and realized a need for some sort of event bus. I'm new to EventEmitters and constructors. I've read up on the docs and well as a bunch of examples, but I honestly don't get why the code below is…
Jeff
  • 607
  • 1
  • 7
  • 17
0
votes
0 answers

Consuming EventEmitter events in nodejs (express/client)?

Going through the https://github.com/alepez/omxdirector code I see a lot of snippets where Events are being emitted by the omxdirector process var play = function (videos, options) { if (omxProcess) { if (!paused) { return false; …
nitimalh
  • 919
  • 10
  • 26