A small functional reactive programming library for JavaScript.
Questions tagged [bacon.js]
200 questions
3
votes
2 answers
How to switch streams based on some EventStream changes in Bacon
Consider this example from http://baconjs.github.io/
var up = $('#up').asEventStream('click');
var down = $('#down').asEventStream('click');
var counter =
// map up to 1, down to -1
up.map(1).merge(down.map(-1))
// accumulate sum
…
![](../../users/profiles/1271209.webp)
gyzerok
- 1,179
- 8
- 24
3
votes
1 answer
Bacon.js restart buffering when another EventStream fires
I'm trying to make a simple canvas-drawing app using Bacon.js. It should allow to draw a line by selecting start and end point using mouse clicks like this.
points = paper.asEventStream('click')
.map((e) -> x: e.pageX, y: e.pageY)
…
![](../../users/profiles/351705.webp)
Yury Tarabanko
- 39,619
- 8
- 73
- 90
3
votes
2 answers
Which actual products (web, mobile apps, etc.) use bacon.js?
Have been reading about Functional Reactive Programming and bacon.js. I have some questions concerning its adoption:
I'm curious about which companies have used bacon.js or are considering its use in actual products? I found this article from…
![](../../users/profiles/2658613.webp)
gaboroncancio
- 800
- 1
- 6
- 17
3
votes
1 answer
Is there an AngularJS ORM
I came a across the following article while considering adding bacon.js and AngularJS:
https://github.com/ProLoser/AngularJS-ORM
But I could not find any other resources that would encourage (or discourage) the use of bacon.js in angularJs.
So I'm…
![](../../users/profiles/732497.webp)
David Laberge
- 13,061
- 14
- 51
- 82
3
votes
3 answers
Bacon.js control buffering of stream with other stream
I want to buffer values of an EventStream in Bacon.js exactly like buffer(closingSelector) behaves in RxJava. When the "controller stream" (closingSelector in RxJava method) emits a new value, then the event buffer gets flushed.
So I want that the…
![](../../users/profiles/3510611.webp)
attekei
- 431
- 3
- 9
3
votes
1 answer
Breaking a cycle in FRP snake in Bacon.js
I've been following this snake example and decided to modify it to generate new apples only in empty (i.e. non-snake) cells. However, that's introduced a cyclic dependency between Observables, since generating new apples now depends not only on the…
![](../../users/profiles/797320.webp)
coudy
- 11,542
- 5
- 19
- 23
3
votes
1 answer
Elm.js "lift" and Bacon.map: Are they functionally the same?
I'm trying to understand Elm. I have a bit of experience with Bacon.js, and it seems to me that lift is, basically, Bacon.js's internal map() function renamed.
Is there more to it than that?
![](../../users/profiles/166838.webp)
Elf Sternberg
- 15,231
- 4
- 52
- 62
2
votes
1 answer
Get EventStream from a node with React and Bacon
This is how I can get an EventStream from a regular DOM node with bacon.js:
var el = document.getElementById('input1');
var stream = Bacon.fromEvent(el, 'input')
When using React, DOM nodes may be recreated after some render() iteration, so…
![](../../users/profiles/3179503.webp)
ch1p_
- 973
- 2
- 7
- 15
2
votes
1 answer
Debouncing unique values with Bacon.js
I have a file system watcher producing a Bacon.js event stream of changed file paths. I'd like to filter and debounce this stream so that each unique file path only appears in the output stream after 5 seconds of no activity for that unique value.…
![](../../users/profiles/71262.webp)
Oran Dennison
- 3,065
- 25
- 34
2
votes
1 answer
Idiomatic way to mutate a property with multiple events using Kefir
What's the idiomatic way to create a property in Kefir that changes in response to multiple event types?
In my project, I started off using rxjs for a FRP-style application. In this application, I wanted to subscribe to state that changed in…
![](../../users/profiles/119549.webp)
Jacob
- 72,750
- 22
- 137
- 214
2
votes
1 answer
Bacon zipped Stream not ending when matches complete causing test suite to hang
I have been trying to use Bacon's zip...() operations to create a Mocha test-suite, where a sequence of values from actual asynchronous networked events could be compared to a sequence of target values to verify correct behaviour.
However, the…
![](../../users/profiles/2257198.webp)
cefn
- 1,468
- 9
- 16
2
votes
1 answer
Never ending stream with Baconjs
I have a simple script which just take all values from Redis list and print them to console.
var redis = require("redis"),
client = redis.createClient();
Bacon = require('baconjs');
Bacon.repeat(function(){
return…
![](../../users/profiles/1907902.webp)
kharandziuk
- 9,273
- 9
- 51
- 94
2
votes
3 answers
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 redis = require("redis"),
async =…
![](../../users/profiles/1907902.webp)
kharandziuk
- 9,273
- 9
- 51
- 94
2
votes
1 answer
Manually trigger Bacon.js stream update?
I'm quite new to FRP and bacon.js, so I might be doing something quite stupid.
The test app has a textarea and a submit button; the submit button adds values to a list and I show the list with React every time there is a change. Here's a gist with…
![](../../users/profiles/213388.webp)
Svilen
- 2,388
- 25
- 25
2
votes
1 answer
What is the equivalint of Bacon.Bus.plug in rxjs
Is it possible to plug in an Observable into a rxjs Subject?
In Bacon i can plug in a new stream easily with the plug method, but in rxjs I haven't find a one-liner yet. so now I do it like this:
var subject = new Rx.Subject();
var clickStream = new…
![](../../users/profiles/686223.webp)
balazs
- 5,294
- 5
- 32
- 45