Questions tagged [subscribe]

994 questions
8
votes
1 answer

Open TK difference onRenderFrame and onUpdateFrame?

I am currently programming a Jump n' Run game in C# using OpenTK Framework and OpenGL. Open TK provides preset functions like GameWindow.Run(); or GameWindow.onUpdateFrame(); onRenderFrame(); As far as i thought through it, all actions that draw…
user3605638
  • 207
  • 1
  • 5
  • 11
8
votes
2 answers

.NET events - blocking subscribers from subscribing on an event

Let's say I have a "Processor" interface exposing an event - OnProcess. Usually the implementors do the processing. Thus I can safely subscribe on this event and be sure it will be fired. But one processor doesn't do processing - thus I want to…
Moshe
  • 555
  • 3
  • 14
8
votes
2 answers

Handling a click on Facebook's "Subscribe" button

How can I fire an event when someone presses the NEW Facebook Subscribe button? I can do that with the "Like" button, using the code above, so I thought that it will be similar with the Subscribe button.
7
votes
2 answers

Error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value

I'm using an auth guard in angular 5 to check if the user should be able to navigate to a specific page. I am getting an error related to returning an observable: A function whose declared type is neither 'void' nor 'any' must return a value. This…
nick gowdy
  • 6,191
  • 25
  • 88
  • 157
7
votes
3 answers

BehaviorSubject subscriber gets same next() element multiple times

I'm using a shareDataService using BehaviorSubject like below. My problem is that every time I call the service's next() method the listener subscription in any other component is called several times, looks like it received the same message several…
Mac_W
  • 2,927
  • 6
  • 17
  • 30
7
votes
3 answers

Possible to subscribe to aws IOT topic in lambda?

Newbie question. Can't find a previous answer. I want to build a simple pump controller with Alexa. Would like Alexa to report pump state. Simplest approach is Alexa -> lambda -> publish_to_Iot. And then, or perhaps just before the publish,…
big
  • 71
  • 1
  • 4
7
votes
2 answers

How to bind this to a function for AngularIO's Observable::subscribe?

There are a lot of examples using the Observable.subscribe() function from AngularIO. Anyhow, I was only able to see anonymous functions inside as in: bar().subscribe(data => this.data = data, ...); If I try to hand in a function of the same class…
user2084865
  • 625
  • 1
  • 7
  • 18
7
votes
1 answer

angular 2 subscribe value change not reflecting on html

This is quite confusing to me. I might not have a solid understanding of how subscription works. Angular 2 finalized version Goal: Hide/Show navigation menu based on roles Approach: I use Facebook to authenticate users. After authentication, user…
7
votes
1 answer

Angular2 - return boolean with subscribe to canActivate

I am new in Angular, I need to implement a function that returns true/false, I going to use the return in canActivate guard, but this function consumes a api by http.get, so like the communication is asynchronous this function always return FALSE,…
Rit
  • 98
  • 1
  • 1
  • 7
6
votes
2 answers

How to add users with email only in Devise

I would like my users to be able to 'subscribe' by only providing an email address without forcing them to sign-up with a password unless they want to. I can add my own validation settings to allow this but i suspect it will interfere with the way…
Ian
  • 315
  • 1
  • 6
  • 13
6
votes
1 answer

Method containing a Subscribe is called multiple times, should I unsubscribe old subscriptions each time?

I'm building an Angular app with subscriptions. The component is a chat message page where there's a menu of all your chat messages to others and you can click on each person to view the chat messages with that person. Here's one of my functions…
cssun25
  • 381
  • 1
  • 5
  • 13
6
votes
2 answers

How to get Contact ID in Mailjet v3 PHP wrapper?

I have used the Mailjet api to store submitted emails in a Mailjet list. This worked properly when there was the Mailjet 0.1 version API (then there wasn't any PHP wrapper but was easy to use with their examples), but when they changed the API to…
Teshan N.
  • 2,307
  • 3
  • 30
  • 59
6
votes
1 answer

Subscribe event for Follow button?

I have read: edge.create - fired when the user likes something (fb:like). But what's fired when the user follow someone (fb:follow)? Thanks
5
votes
1 answer

In Angular where to subscribe in service or in component & why?

This question is very common, some prefer to use in service some in component: Angular 2 subscribe from component or service?: it says never do the manual subscription means from component! If we don't want any data then why we need to subscribe(in…
Ali Adravi
  • 21,707
  • 9
  • 87
  • 85
5
votes
2 answers

Angular 2 Cannot read property 'subscribe' of undefined TypeError: Cannot read property 'subscribe' of undefined

I have tried many propositions on fixing this error here on stackoverflow, but now I just need to ask as I have spent many hours with literally getting nowhere now. I have this simple Service: constructor(private http: Http, private tokenResolver:…
jibjapda
  • 87
  • 2
  • 2
  • 9
1 2
3
66 67