Questions tagged [bacon.js]

A small functional reactive programming library for JavaScript.

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 …
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) …
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…
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…
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…
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…
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?
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…
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.…
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…
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…
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…
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 =…
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…
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…
balazs
  • 5,294
  • 5
  • 32
  • 45
1 2
3
13 14