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

angular filereader event emiiter

I have a angular4 app, where the user will browser a file and I read the file using the filereader and send the complete file in the evenemitter. Below is the code for reading the file. readThis(inputValue: any): void { const file: File =…
user7000
  • 99
  • 2
  • 9
0
votes
1 answer

In node, what is the best way to reset a variable right after emitting a message

I'm currently using ES6 classes. I have a scenario where one emits a message, sending the values within an instance variable, and then I need to reset the variable after emitting. So it looks something like the following (and works as intended, but…
philip yoo
  • 2,462
  • 5
  • 22
  • 37
0
votes
1 answer

How to trigger an event in external js file?

This is app.js file; const MyTest = require('./testApp'); const App = new MyTest(); App.on('ready', () => { console.log('Hello World'); }); Package.json file. (in) ./testApp/package.json; { ... "main": "main.js" ... } This is…
Yankı Küçük
  • 3
  • 1
  • 1
  • 5
0
votes
1 answer

EventEmitter in new instance

What is the proper way to get 'poof1' event without timeouts? Now it's only 'poof2' fires up. function Em(cfg){ let event = new EventEmitter(); event.emit('poof1'); setTimeout(() => { event.emit('poof2'); }, 1000); …
John Lenson
  • 167
  • 2
  • 9
0
votes
1 answer

Angular trigger EventEmitter whenever object contents is changed

I'm using a child component to build a complex object consisting of recursive child arrays and objects. I'd like a way to get access to this object in the parent component using live binding. Values within the object change based on user input…
NJ.
  • 7,486
  • 1
  • 19
  • 20
0
votes
3 answers

Node event emitter - How to convert Class to Class Syntax

I found an example of creating an event Emitter class that takes a stream (tcp net connection) and emits it's own custom events from the data events it pulls off of that stream. No matter what I do I can't remake it will es6 class syntax. I saw in…
MFave
  • 1,044
  • 2
  • 8
  • 19
0
votes
0 answers

angular 2 - pass 2 parameters to an EventEmitter

My question is similar to that question: How to pass 2 parameters to EventEmitter angular 2 i've read the question and the answers, and followd the answer that seem to work for my case but it didnt work in my case. i need to pass 2 parameter from 2…
MetaDude
  • 139
  • 5
  • 14
0
votes
1 answer

Calling emit in js

I'm stuck trying to answer what would happen if emit doesn't have any registered listeners. Can it cause to vulnerability if the client is spaming by emits without any listeners? while(true){ socket.emit('not_registered_event_string'); }
Max Bender
  • 372
  • 4
  • 14
0
votes
1 answer

Angular EventEmitter exposing value to parent component

In my Angular application I have a child grid component inside of my parent component, and I am trying to emit some data from my child grid to the parent container. I have used event emitter to try to "emit" that value to the parent, but when I try…
MadCatm2
  • 951
  • 4
  • 24
  • 41
0
votes
2 answers

events are not getting emitted or they not getting caught nodejs

I dont know what is the problem with my code. // emitter.js var EventEmitter = require('events').EventEmitter; var util = require('util'); function Loadfun(param1, param2, db){ function __error(error, row){ if(error){ …
Demolition
  • 138
  • 1
  • 1
  • 10
0
votes
1 answer

Return values using EventEmitter angular2

I have an EventEmitter that issues an event in the parent component, I want it from the parent component to perform a series of instructions and the result returns it to the caller, this.filteredList I want it to contain the list returned by the…
ararb78
  • 1,137
  • 5
  • 19
  • 44
0
votes
1 answer

How to listen to events emitted in subclass objects

func parent(children){ for(var i =0;i
Rajiv Prathapan
  • 75
  • 1
  • 10
0
votes
1 answer

Error - EventEmitter memory leak detected. 11 wakeup

Error: (node) warning: possible EventEmitter memory leak detected. 11 wakeup listeners added. Use emitter.setMaxListeners() to increase limit. The question is whether to pay attention to it and increase the limits? Or can I ignore it? In fact, it…
coder fire
  • 993
  • 2
  • 11
  • 24
0
votes
1 answer

Sending notification from nodejs server to angularjs

I have an angularjs module deployed on a nodejs server. The nodejs also has an REST end point. Whenever I get a hit in the nodejs REST end point, I want to update a scope variable in angularjs script and then I have to redirect the user to a page…
Albie Morken
  • 215
  • 1
  • 4
  • 14
0
votes
2 answers

function to es6 class base style

i'm newie in es6 and eventEmitter both. i've prepare a module in node event base style and now i'm trying to transform as es6 calass style. here it is // eventStyle.js const events = require('events'); const util = require('util'); var Customer =…
shivshankar
  • 2,067
  • 1
  • 18
  • 28