Questions tagged [bacon.js]

A small functional reactive programming library for JavaScript.

200 questions
4
votes
1 answer

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?
Ramith Jayatilleka
  • 2,072
  • 12
  • 25
4
votes
1 answer

What is the Evaluation Model of Bacon.js?

Most resources on reactive programming, e.g. "A Survey on Reactive Programming" (Bainomugisha et al., 2012), introduce several characteristics by which different reactive solutions can be classified. One of these is which evaluation model is…
lkbaerenfaenger
  • 5,652
  • 5
  • 21
  • 33
4
votes
1 answer

FRP with Bacon.js - how to model a pause button?

I'm trying to get my brain around Functional Reactive Programming, and specifically FRP with Bacon.js and am having trouble finding the right combinator for creating a pause button. var pauses = $('.pause').asEventStream('click'); var plays =…
George Mauer
  • 103,465
  • 117
  • 349
  • 581
4
votes
1 answer

Bacon.js Maximum Call Stack Exceeded

I'm trying to produce a stream similar to Bacon.fromPoll for requestAnimationFrame Why does the following code produce a "Maximum call stack exceeded" error? function rafSequence() { var raf = Bacon.fromCallback(function(callback) { …
jcbelanger
  • 539
  • 3
  • 15
3
votes
1 answer

My Throttable EventStream implementation - is it redundant?

Subject: I have a stream (actually combined stream from Bacon.interval and buttons clicks EventStreams) wich fires ajax request and solve task of manual and automatic data refresh. Problem: After manual events (buttons clicks) I need reset timer…
basil
  • 2,994
  • 2
  • 19
  • 18
3
votes
2 answers

Stream of arrays into array of streams operator

In Rx.js, how to turn a stream of arrays into array of streams for example i have a stream of following:['0a','0b'], ['1a','1b'],['2a','2b','2c'] and i want to get the following streams: 0a---1a---2a---> 0b---1b---2b---> 2c---> Are there…
3
votes
1 answer

Functional Javascript BaconJS, how can I push more values to an event stream?

I'm attempting to create a stack of AJAX responses in BaconJS. That processes them in a first in first out fashion, but each 'out' event should wait for user input. This is where I'm at now: Live JSBin var pages = Bacon.fromArray([1,2,3]) var next =…
user916367
3
votes
0 answers

Paged source stream in reactive application

I am working on an application being built with Bacon.js, and using React for rendering (though that doesn't seem to be germane to the question. I am building a page that is an infinitely scrolling list of data. You can filter or sort the results,…
Matt
  • 2,807
  • 1
  • 27
  • 45
3
votes
2 answers

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 Bacon Stream return true, otherwise false } What…
Tero Tolonen
  • 3,659
  • 3
  • 21
  • 27
3
votes
2 answers

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 clicks undo, I take a value from the stack and…
VoY
  • 5,111
  • 1
  • 33
  • 43
3
votes
2 answers

Assemble paginated ajax data in a Bacon FRP stream

I'm learning FRP using Bacon.js, and would like to assemble data from a paginated API in a stream. The module that uses the data has a consumption API like this: // UI module, displays unicorns as they…
SimplGy
  • 18,875
  • 14
  • 95
  • 138
3
votes
1 answer

Beginner problems with reactive programming

I'm using Kefir.js for reactive programming, but I have some troubles. I have a device with N sensors (temperature, pressure, time, ...) and I think it would be great idea if I represent sensors as streams. So I end up with this code: function…
user1518183
  • 4,255
  • 4
  • 24
  • 39
3
votes
3 answers

RxJS equivalent of `Bacon.when()` with properties (which are sampled but not part of the synchronization pattern)

Consider the following Bacon.js code sample (loosely based on the code here, uses bacon.model & bacon.jquery): / =
Tim Molendijk
  • 922
  • 1
  • 9
  • 14
3
votes
2 answers

What is different between onValue and doAction in BaconJS?

onValue "subscribes a given handler function to event stream. Function will be called for each new value in the stream. [It] is the simplest way to assign a side-effect to a stream." On the other hand, doAction "returns a stream/property where the…
chreekat
  • 894
  • 7
  • 15
3
votes
1 answer

map a stream to lazy promise stream

I have a I have a stream of numbers, I have to turn them into a stream of posts using a promise. And I want to do this lazily. So if I do .take(1) from the post stream, it will turn only one number to a post. This is the promise that gets a post…
user3995789
  • 3,382
  • 1
  • 15
  • 29
1
2
3
13 14