All Questions
15 questions
0
votes
1
answer
208
views
How to model imperative code with async await and mutations to reactive streams
let drawer = {};
let stacks = {};
async function actionDealCard(hidden) {
let previousMutation = drawer.mutation;
drawer.mutation = true;
await ...
0
votes
1
answer
63
views
Optional fields in baconjs form
I'm building customisable form in bacon.js. I have a problem with optional fields that can be empty e.g. phone is sometimes required or sometimes optional.
field_events = _.merge(
_.mapValues(@...
4
votes
1
answer
340
views
RxJS alternative to Bacon.combineTemplate
Can anyone provide a function which can be Bacon.combineTemplate alternative written in RxJS?
0
votes
1
answer
110
views
Wait for latest values from dependent ajax streams in BaconJS?
I have 3 streams. (1) gradingResult and contextId are ajax requests that depend on studentResponse. (2) For each studentResponse value, I need to fire an event with the studentResponse value and the ...
0
votes
2
answers
195
views
Wait for latest values from dependent streams in BaconJS?
I have 3 streams. gradingResult and contextId depend on studentResponse. I need to fire an event and only one event (otherwise, this is trivial) when all 3 have the latest values.
I've tried #...
0
votes
1
answer
193
views
Calculate the Cartesian product (xprod method) of two Observables
I have one interesting question. Maybe anybody know how could I implement a method like a http://ramdajs.com/docs/#xprod. I have one solution which I found:
let as = [1, 2, 3];
let bs = ['a', 'b', 'c'...
8
votes
2
answers
4k
views
How to handle mouse and touch events simultaneously with reactive event streams
I'm building an audio playback control that lets users scrub back and forth through an audio file. It needs to work with touch and mouse events. How should I go about managing the events for this with ...
1
vote
1
answer
311
views
Dynamic piping with FRP
Consider a problem:
split file by lines
write lines to a result file
if a result file exceeds some size create a new result file
For example, if I have a file which weights 4gb and split size is equal ...
3
votes
2
answers
2k
views
What is the best way to detect if an Object is an instance of a Stream Class?
Is there a way to detect if an object is an instance of a stream -class? For example RxJS or Bacon.js stream.
What I'm looking for is something like
function isStream(obj) {
// if obj is RxJS or ...
89
votes
1
answer
31k
views
Node.js Streams vs. Observables
After learning about Observables, I find them quite similar to Node.js streams. Both have a mechanism of notifying the consumer whenever new data arrives, an error occurs or there is no more data (EOF)...
3
votes
3
answers
919
views
Rewrite event emitter with Reactive programming(Semaphore example)
I'm use event emitters as synchronization primitives. For example I have one class which asks semaphore like structure in Redis. If semaphore is set it emits an event. The code is listed bellow:
var ...
3
votes
2
answers
455
views
Functional reactive operator for custom filter based on another Observable
For fun and to learn I'm trying to implement an undo system in my app using functional reactive programming. I have a stream of state changes, which need to be saved onto the undo stack. When the user ...
4
votes
1
answer
2k
views
What is the RxJS equivalent of Bacon.js bus?
How can I create an Observable that I can just directly push events to, like with Bacon.js's Bus?
18
votes
1
answer
1k
views
Does Functional Reactive Programming in JavaScript cause bigger problems with listener references?
In JavaScript the observer pattern is used quite often. There is one tricky thing with it and that's the references the subject keeps of the observers. They require cleanup. For regular applications I ...
0
votes
1
answer
67
views
BaconJS observable zip, sample property map fail
I am trying to produce the zip example from BaconJS. But it doesn't work.
var obs = Bacon.fromArray([{ x: 1, y: 2 },
{ x: 3, y: 4 }]);
var x = obs.map('.x');
var y = obs....