Questions tagged [observable]

An observable is typically a programming construct that can be "watched" by other parts of the code, called the "observers". Different frameworks and programming languages have different implementations for observables, so this tag should typically be used in conjunction with others.

An observable is typically a programming construct that can be "watched" by other parts of the code, called the "observers". Different frameworks and programming languages have different implementations for observables, so this tag should typically be used in conjunction with others.

An observer may be any object that implements interface Observer. An observable object can have one or more observers. After an observable instance changes, an application calling the Observable's “notification” method causes all of its observers to be notified of the change by a call to their update method.

References

9527 questions
3
votes
1 answer

Combining an observable with the latest value of another observable

I have 2 observables A and B. I would like to generate C that emits only when A emits, with a combination of the value just pushed in A, and the most recent value in B.
SuperJMN
  • 13,110
  • 16
  • 86
  • 185
3
votes
2 answers

How to forkJoin() void functions?

For example I have voidFucntion1(), voidFunction2(), I want to Observable.forkJoin([voidFunction1(), voidFunction2()]).subscribe() ; However this is not working at all, so how to cast void functions ? without changing the original voidFunction() ?
tomriddle_1234
  • 3,145
  • 6
  • 41
  • 71
3
votes
2 answers

How to pause Observable?

I am working on my first Angular 2 product. I created this Observable.timer and then subscribed to it. It polls the server for data. How do I pause and unpause this? ngOnInit(): void { this.poll = Observable.timer(500,500).subscribe((t: any)…
Jerry Huckins
  • 498
  • 3
  • 7
  • 22
3
votes
1 answer

Sharing Observable between Activities with RxJava and unsubscribing

I'm trying to implement a timer Observable that is Shared between the Activities of my application. I am making the implementation on a class that is a Dagger singleton which I inject in each Presenter of each different Activity. I create the…
antonicg
  • 934
  • 10
  • 24
3
votes
2 answers

How to make a complex object an Observable

I have multiple JavaFX panes and canvases that reference a complex object with data they need, and I want them to redraw when the object changes. This would call for the object to be Observable, but which class do I use? JavaFX seems to mostly have…
EboMike
  • 76,846
  • 14
  • 164
  • 167
3
votes
1 answer

The right time to remove subscription for observable that is only used once

I have the following login function that I want to use just once to login as oppose to sit there an listen for data forever. So I am looking for the right time to call the unsubscribe method. At the moment, I am calling the unsubscribe method…
3
votes
2 answers

BehaviorSubject keeps resetting to original value

I have an angular 2 project, in which I have a couple of components. One of the components keeps track of a member (that is the aforementioned BehaviorSubject) using a subscription. The BehaviorSubject's value is updated and pushed when a user…
Dan Bachar
  • 149
  • 2
  • 12
3
votes
1 answer

Rx Java zip completes when any subject completes

I am facing with the problem. As far as I know zip method from RxJava waits for all observables to complete. But am I getting another behaviour. Here is my code snippet private PublishSubject firstSubject; private PublishSubject
user4598738
3
votes
1 answer

Register User with Firebase and AngularFire2

In my app.component.ts, the am using this function to register the user onto firebase using angularFire2. However I am getting an error with "property 'subscribe' does not exist on type 'void". register() { …
user172902
  • 3,541
  • 9
  • 32
  • 75
3
votes
1 answer

Reset Knockout observable variables to its start value

I'm curious to know if Knockout implement a method to reset a observable variable to its start value. For example: var test = ko.observable("test"); test("ciao"); test.reset(); value come back to "test". Exist something like this or a field that…
Steph8
  • 1,483
  • 2
  • 16
  • 32
3
votes
1 answer

JavaFX SimpleObjectProperty vs SimpleTProperty

What's the difference between using SimpleStringProperty vs SimpleObjectProperty < String > or SimpleIntegerProperty vs SimpleObjectProperty< Integer > Besides returning wrappers and not primitive types?(It can be auto casted anyways)
ESipalis
  • 381
  • 4
  • 17
3
votes
1 answer

JavaFX – ObservableList and list's item change

This answer provides a solution for an observable list that will send "list updated" notifications if properties of elements of the list change. In my case, elements (a Element class) of such observable list are complex and I don't like to implement…
David
  • 527
  • 1
  • 8
  • 21
3
votes
1 answer

What's causing lag between observable returning result and displaying result in browser?

I'm using Angular 2 and GeoFire to display nearby professionals in an area. I created a service to use GeoFire to return an observable of a list of professionals, but I'm getting a massive delay between getting that list and having it…
RedFour
  • 43
  • 5
3
votes
1 answer

How did several subscription on one observable

Sorry for my English. I have service that provide in main module. When did happen change this.userSettings object using setSettings method I want that all subscribers on userSettingsObservable were called. Subscription happens in different…
SIARHEI PAKHUTA
  • 175
  • 2
  • 12
3
votes
1 answer

ShinyApp with dynamic text appearing on any change across a number of UI elements

I'm interested in developing a Shiny App that would act in the following manner: Update the chart following any changes to the number of user interface elements. This done through the actionButton / isolate construct. Display a warning text…
Konrad
  • 17,740
  • 16
  • 106
  • 167