Most resources for reactive programming, for example. The Reactive Programming Review (Bainomugisha et al., 2012) introduces several characteristics that can be used to classify various reactive solutions. One of them is which evaluation model is used, that is, whether the reactive language (or library) is push or pull-based (or both).
Example: consider this piece of pseudocode: var c = a + b;In a reactive environment, it cis expected that it will contain the sum aand b. Accordingly, if aor are bchanged, the value cmust be recalculated. In a push-based solution aand bnotify cwhen their values have changed, so that the value ccan be recalculated instantly. In a solution based on stretching, it cscans the current values aand bas soon as the value is required c. Thus, all repeated calculations are delayed until a value is requested c.
For some time, I tried to figure out which assessment model is used by the Bacon.js JavaScript library. Assume the following:
var a = Bacon.constant(21);
var b = Bacon.constant(21);
var c = a.combine(b, function (x, y) {
return x + y;
});
Bacon.js, , combine, , " , ".
- 1: " "?
- 2: , - , - Bacon.js , pull-based? ?
Bacon.js , "[t] o , [] flatMap". , :
- 3: , , Bacon.js push,
flatMap? - ? - 4: ,
flatMap combine. , , , Bacon.js , push-based?
, , .: P