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
2 answers

Node.js listen and emmit events

I have two classes and i want one class to be subscribed to the other. So something like this. Class one: while(1){ if(true){ //emmit some event } Class two: //wait for class one to emmit some data ,and then start working with the data My…
DavidS
  • 13
  • 6
0
votes
1 answer

How to get items in asynchronous environment in different components?

I have main component with this code(without imports): class AppComponent { products = null; productsUpdated = new EventEmitter(); constructor(product_service: ProductService) { this._product_service = product_service; …
graver
  • 57
  • 5
0
votes
1 answer

How to pass a function declared inside an object to child component

I have a DatagridComponent which just displays some rows with data in it. This one can pass action bar items to this component as many as he wants, and pass a function with it which gets called when an items (it's simply a button) gets…
nintschger
  • 1,786
  • 5
  • 30
  • 45
0
votes
0 answers

JestJS can't instantiate new EventEmmiter in spec files

Whenever I try to test a component which is using eventemitter2 and tries to make a new instance of it so for example import EventEmitter from 'eventemitter2' and then new EventEmitter() in my spec files, it throws an error TypeError:…
Wojciech Jeleń
  • 389
  • 2
  • 11
0
votes
0 answers

Angular 4 Component to Component Communication

I'm sending an API call on app.component.ts and emitting the change, so i can get the emitted value in the in the child components. Everything is working fine until a router redirect comes. After the router redirects the data is not rendering since…
sinthu225
  • 301
  • 3
  • 16
0
votes
2 answers

Connect event emitter with instance of each ES6 class in node

I'm trying to associate each instance of a class with an event emitter. I'm trying the following: const events = require("events"); const eventEmitter = new events.EventEmitter(); class Camera { constructor(ip) { this.ip = ip; …
Philip Kirkbride
  • 21,381
  • 38
  • 125
  • 225
0
votes
1 answer

Node ES6 class event emitter function?

I'm trying to create a class for which all instances respond to an event: const events = require("events"); const eventEmitter = new events.EventEmitter(); class Camera { constructor(ip) { this.ip = ip; } …
Philip Kirkbride
  • 21,381
  • 38
  • 125
  • 225
0
votes
0 answers

@output newEvent emitter deletes the main object propetties issue in angular4?

I have two components 1) usercomponent(parent) 2) multiselectcomponet(child) usercomponent.ts items = [{ "Id" : "1", "companyName" : "Synaptech", },{ "Id" : "2", "companyName" :…
Runali
  • 332
  • 1
  • 4
  • 17
0
votes
0 answers

Using @Output hide to some child component

My issue is I would replace/hide some child components (Child1, 2 and 3) by a "subchild component" each time the toggleSubChild() function is called using @Output decorator (it's just an idea, maybe there's better way to do that); So each time the…
Emile Cantero
  • 1,943
  • 3
  • 22
  • 47
0
votes
0 answers

Reassign an event emitter in NodeJS

I'm using the MQTT npm module. When fires the myMqttObj.on('close',...) event I call myMqttObj.end() and then reassign it with a new connection: myMqttObj= mqtt.connect(....) In this way all the previous myMqttObj.on() methods are listening on the…
Nicola
  • 465
  • 2
  • 7
  • 19
0
votes
2 answers

Angularjs (1.6) sharing a function using $broadcast,$on?

Is it possible to use $broadcast and $on/$emit to share a function in a component that exists inside its controller to a totally different controller under different component (see pic above)?. I have tried different examples from google, not sure…
jsPlayer
  • 1,195
  • 7
  • 32
  • 56
0
votes
1 answer

@Output() EventEmitter Not Working

I try to make a see more button to get more search results at the moment of clicking. I have my header in separate arrchivos and I use it with:    For each view. The button that generates the…
0
votes
1 answer

How to create dynamic angular JS 4 child components based on a previous server side call

As soon as my application is launched, I access the IP address of the client and pass it on to the server. Based on the client IP the server will furnish some data. Using this data I will decide how many child components should be embedded on the…
Adam
  • 1,221
  • 4
  • 13
  • 27
0
votes
2 answers

Node MySQL Pool Cluster Event Emitter Not Working

The documentation gives examples of registering connection event emitters for pools: pool.on('connection', function (connection) { connection.query('SET SESSION auto_increment_increment=1'); }); Documentation shows how to get a pool from a…
sam-6174
  • 3,104
  • 1
  • 33
  • 34
0
votes
1 answer

nodejs socket.io can not emit internal event

I am trying to emit logout event to erase client session and disconnect him. But I can not find proper solution online to do it. here is my code with comments: exports.post = function(req, resp, next) { var sid = req.session.id; var io =…
ovod
  • 1,118
  • 4
  • 18
  • 33