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

How to share *only* the events of an object in node.js?

I'd like for an object B to subscribe to the events than an object A emits—however, I don't want to pass the object B itself to A, because of the potential for another developer (or myself in the future) to abuse presence of B in A, and thus tightly…
xyz
  • 1,513
  • 2
  • 13
  • 17
0
votes
0 answers

EventEmitter not working Angular 2

I have a list of restaurants and when clicking on one of them I want the EventEmitter to take the restaurant component information and supply the details component with it. I am trying with the following code. When I'm running getRestaurantDetails()…
fryjabe
  • 3
  • 2
0
votes
1 answer

Function Not Running When Placed Within Angular's ngOnChanges Life Cycle Hook

I am in the process of checking to make sure I'm getting certain values sent to one component from another via Angular's custom Output() and EventEmitter(). They are being sent from my first component's view like this:
Rey
  • 1,393
  • 1
  • 15
  • 24
0
votes
1 answer

How do I store more than the most recent value passed in via Output() and EventEmitter() in Angular?

I am using custom outputs in my Angular app to send user-selected values between components. Right now what's working is that each time a user clicks a check-box item, that value is sent through to my sub-component, where I can see it print to the…
Rey
  • 1,393
  • 1
  • 15
  • 24
0
votes
2 answers

Node.js - Listen for when listeners are registered

In Node.js, we have the standard event emitter: const EE = require('events'); const ee = new EE(); ee.on('x', function(){ }); what I would like to do, is listen for when a client registers a listener. The purpose is so that if the emitter is in…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
0
votes
1 answer

Component does not get cleared when values are reset

I have a child component as follows, Child component.html
user7426734
0
votes
2 answers

Angular2 How to pass selected value to other component

Hi I am tryng to pass value selected from one of the options. I used ngModel to save the value but I can't figure out how to pass it to other component. Since they are connected but not nested, I couldn't use Eventemitter cause I reckon to use…
Lea
  • 1,245
  • 5
  • 22
  • 31
0
votes
0 answers

How do implement maximum operations at a time

I would like to know if it is possible to implement an event with a maximum number of operations at a time. Example: const myEvent = EventEmitter(); myEvent.on("calculate", (file) => { // async operation here // calls data event passing the data…
user5487299
0
votes
1 answer

ReactJS and Auth0 problems in getting profile and EventsEmitter

So, I was exploring auth0 for a pet project. I was able to configure the authentication for my app with the help of their documentation and the step by step guide provided in the website. The next step was getting the profile from auth0, it was…
Arvind
  • 730
  • 10
  • 20
0
votes
2 answers

Wait for promise to resolve to within an emitter.on listener function

When the someevent event is fired I simply want to wait for the promise to be resolved before continuing. But slowFunctionThatReturnsPromise takes a long time to resolve and the overall process shuts down before it is resolved. Therefore it is never…
jmccure
  • 1,180
  • 7
  • 16
0
votes
2 answers

Angular 2 : Cannot read property 'close' of undefined

I am new to Angular 2 and I am trying to bind an "onclick" event to a #sitenav object in a parent component/template. menu.html (Child template)
HGB
  • 2,157
  • 8
  • 43
  • 74
0
votes
1 answer

Emit custom event in Angular2 and TypeScript

In short, I have basically mocked this: http://learnangular2.com/outputs/ Here is what I do: Send Login Request using login.service.ts (axios module) Handle the form submit - if success route away else display modal with issue (in the case of…
LostJon
  • 2,287
  • 11
  • 20
0
votes
1 answer

How to set a callback function to be the first callback in EventEmitter?

I have a shared event emitter say myEmitter. myEmitter.on('fire', callback1); myEmitter.on('fire', callback2); ... myEmitter.on('fire', callbackN); Now the problem is: I want myEmitter.on('fire', myTopCallBack); and I want myTopCallBack to be…
Xin
  • 33,823
  • 14
  • 84
  • 85
0
votes
0 answers

Node.js: event emitters not firing properly

I created a project that recursively looks for valid media file types from an array of directories. The issue is that two of my event emitters are working correctly and two are not. I've read the docs, watched some videos, and searched this site…
DJFalstaff
  • 265
  • 2
  • 8
0
votes
1 answer

Error on Click event Cannot read property 'stat' of undefined

I have the main component which is called app.component and a sub component if I am allowed to call it like that called items.component. The script of app.component is: import { Component, EventEmitter, Output } from '@angular/core'; import {…
alim1990
  • 4,656
  • 12
  • 67
  • 130