A small functional reactive programming library for JavaScript.
Questions tagged [bacon.js]
200 questions
0
votes
0 answers
fromNodeCallback callback methods order of defintion
Im learning bacon.js
i wrote test script like that.
var bacon = require('../nodejs/node_modules/baconjs').Bacon;
function TestClass(URL,port,username,password)
{
this.funcCheck = function( data , rescallback)
{
console.log(" data: " +…
![](../../users/profiles/293406.webp)
AlexS
- 827
- 3
- 14
- 23
0
votes
1 answer
How do I filter end events in bacon.js?
It seems I need to do stuff on an ended stream, but not with an .onEnd(). Let's say I've got a list of URLs which I need to fetch per XHR and inject into my application. After that's done, I'd like to do continue doing something that depends on that…
![](../../users/profiles/6460.webp)
Nikolai Prokoschenko
- 7,353
- 6
- 48
- 89
0
votes
1 answer
Lazy.js based fibonacci to map Bacon.js interval?
I have a code to generate fib sequences with lazy.js
var fibF = function()
{
var seq = []; //build sequence array in this closure
var f = function(n)
{
var val;
if (n <= 1)
{
val = 1; // as the Fib definition in Math
}
…
user1028880
0
votes
1 answer
Using multiple event stream values with Bacon.js
I have a form with currently 2 inputs (amount will increase), where users add/edit numbers. After a change in any of the fields, I want to make a calculation with both numbers.
With basic jQuery, it would be a breeze:
var f1 = $(".field-1"), f2 =…
![](../../users/profiles/1039556.webp)
Apeli
- 379
- 5
- 16
0
votes
2 answers
Why are bacon.js observables classified lazy sequences?
My understanding of lazy sequences is that they don't load data in memory until it's accessed by the program. So I can see how this would make sense if there was a large list of numbers, waiting to be consumed, but the sequence only pulled in the…
![](../../users/profiles/1375688.webp)
tldr
- 10,743
- 11
- 69
- 111
0
votes
0 answers
mapping knockout observable changes to event streams
I'm working off of a module that's built in knockout.js and I want to map changes to observables onto an event stream after the manner of RxJs, highland.js or bacon.js.
I know there are ways to do this by extending knockout, like…
![](../../users/profiles/1137835.webp)
matchdav
- 685
- 7
- 16
0
votes
1 answer
Implementing producers/consumers with bacon.js event stream pool
I want to implement the producer consumer pattern with a pool of bacon.js event streams. Here's the specific problem I'm trying to solve:
I have a list of 'n' urls. I want to create event streams to make http requests for those urls, but I want to…
![](../../users/profiles/1375688.webp)
tldr
- 10,743
- 11
- 69
- 111
0
votes
1 answer
Access Property value before any consumers are attached
Well Bacon is still one big surprise for me...
bus = new Bacon.Bus()
busProperty = bus.toProperty()
bus.push 'someValue'
busProperty.onValue (val) ->
console.log val
This way, nothing is logged to console at all. I am probably looking from…
![](../../users/profiles/902813.webp)
FredyC
- 3,339
- 2
- 26
- 36
0
votes
2 answers
Ignore past values from FRP event stream
I am using BaconJS to create two event streams likes this:
# Wait for start of the module
sStart = Bacon.fromCallback module.onStart.bind(module)
# Watch game ticks
sTick = Bacon.fromEventTarget emitter, 'tick'
# Combine it to do…
![](../../users/profiles/902813.webp)
FredyC
- 3,339
- 2
- 26
- 36
0
votes
1 answer
Using Angular-Bacons $scope.$watchAsProperty(property) in Angulars ng-repeat
I´m trying to find a good way to use Baconjs together with Angularjs in conjuctions with Angular-Bacon.
Now digesting from Bacon to the Angular scope works perfectly fine but I´m stumbling with Angular-Bacons $scope.$watchAsProperty(property) within…
![](../../users/profiles/3628380.webp)
Finn
- 77
- 4
0
votes
1 answer
Use variable as EventStream or Property in Bacon.js
I'm new to Bacon.js and I'm trying a lot to figure out how it works. So, is there a way to use variable, for example the hash from the URL, as if it would be an EventStream of onVariableChange events. Sorry if what I'm writing is awkward.
Here is my…
![](../../users/profiles/2205699.webp)
Alex Leu
- 23
- 4
0
votes
2 answers
Native JS in node.js and FRP(bacon.js)
I want to use FRP in my project. For node.js I found just one most popular lib, which realize FRP. It's bacon.js.
But I don't found exampes of using bacon.js in node.js in native JS (not coffeeScript, not Closure). How can I use
backon.js in native…
![](../../users/profiles/3386802.webp)
Michael Skvortsov
- 171
- 1
- 3
- 7
0
votes
1 answer
Bacon Bus weird behaviour with end of stream event
This works fine:
var Bacon = require('baconjs');
var a = Bacon.fromArray([1,2,3])
a.onValue(function(val){
console.log(val)
})
a.onEnd(function(){
console.log("END")
})
... meaning that onValue and onEnd got called properly and this is the…
![](../../users/profiles/325458.webp)
haknick
- 1,862
- 1
- 20
- 28
0
votes
2 answers
Bacon.js, delay each value in the stream by 1 second
I have this:
var bulk = array[1,2,3,4]
var finalResult = Bacon
.fromArray(bulk)
.flatMap(isValInCouchDb)
.filter(onesThatExist)
.flatMap(putValInCouchDb)
I need right after the filter to delay the whole stream by 1 second and then…
![](../../users/profiles/325458.webp)
haknick
- 1,862
- 1
- 20
- 28
0
votes
1 answer
Is there an inverse of fromNodeCallback?
Is there something in bacon.js that converts back to a node callback, like Q does with it's node adapters? https://github.com/kriskowal/q#adapting-node
![](../../users/profiles/304262.webp)
Mattias Petter Johansson
- 974
- 1
- 14
- 31