1

Why the construction like

$("#clickme").asEventStream('click').onValue(callback1).onValue(callback2);

doesn't work, but this one

var promise = $("#clickme").asEventStream('click');
promise.onValue(callback1);
promise.onValue(callback2);

works.

Doesn't the onValue method return reference to object? Is any purpose of that?

OlliM
  • 7,023
  • 1
  • 36
  • 47
speedingdeer
  • 1,236
  • 2
  • 16
  • 26

1 Answers1

5

The onValue method returns a function for unsubscribing, hence is not chainable.

raimohanska
  • 3,265
  • 17
  • 28