Questions tagged [bacon.js]

A small functional reactive programming library for JavaScript.

198 questions
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
  • 974
  • 7
  • 16
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,452
  • 1
  • 19
  • 35
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,338
  • 2
  • 11
  • 26
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
  • 44,270
  • 9
  • 84
  • 98
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
  • 870
  • 1
  • 7
  • 19
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
  • 15,435
  • 14
  • 53
  • 83
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
  • 491
  • 4
  • 10
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
  • 16,129
  • 6
  • 60
  • 68
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_
  • 1,193
  • 2
  • 8
  • 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,237
  • 1
  • 29
  • 37
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
  • 77,566
  • 24
  • 149
  • 228
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
  • 2,895
  • 19
  • 28
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
  • 12,020
  • 17
  • 63
  • 121
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,608
  • 24
  • 26
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,698
  • 7
  • 37
  • 45
1 2
3
13 14