Questions tagged [bacon.js]

A small functional reactive programming library for JavaScript.

198 questions
0
votes
1 answer

merge streams sequentially with correct order using flatMap or flatMapConcat

I have two streams: getPost is a fromPromise stream that streams a single post. sample: author done getPostsStream streams a list of posts for a given author. sample: a1 done, a2 done I have 3 authors, it's also a stream, sample:…
user3995789
  • 3,452
  • 1
  • 19
  • 35
0
votes
1 answer

Sequential conditions in Bacon/FRP

Is there a way to combine two streams S1 and S2 into a third S3 which emits on the first S2 event AFTER S1 has emitted? For example: S1 --*----------------*------*--*--*----------- S2 ------*--*--*----------*-----------*--*--*-- S3…
estolua
  • 676
  • 4
  • 11
0
votes
1 answer

Random numbers stream with Bacon.js

I'm trying to dive in reactive programming. So I decided to create a simple chat with RSA encryption using Bacon javascript library. The questions I have: What is the best way to create random numbers stream with Bacon? After it I want to filter…
gyzerok
  • 1,338
  • 2
  • 11
  • 26
0
votes
1 answer

What is the best way to do multiple validations with different error messages on single field using bacon.js?

I want validate single field using few rules There is simple example. This is html form:
Mikhail Vaysman
  • 412
  • 3
  • 10
0
votes
1 answer

BaconJS observable zip, sample property map fail

I am trying to produce the zip example from BaconJS. But it doesn't work. var obs = Bacon.fromArray([{ x: 1, y: 2 }, { x: 3, y: 4 }]); var x = obs.map('.x'); var y = obs.map('.y'); var result = x.zip(y, function(x, y) { …
user3995789
  • 3,452
  • 1
  • 19
  • 35
0
votes
1 answer

QUnit ignore error from source

I wrote some tests using jQuery's qUni for some Bacon.js functions i did. However Bacon.js throws an error and qUnit marks the test as failed but the outcome is correct and the equals() methods work ok. My question is can i make qUnit ignore a…
Razvan
  • 710
  • 3
  • 9
  • 25
0
votes
1 answer

Bacon.js and awaiting AJAX response

I've been trying to get something like the following working: var showAjaxIndicator = ajaxRequest.awaiting(ajaxResponse) What I'm seeing however is that showAjaxIndicator will finish on true -- I do not see a final false when the request has…
jsleeuw
  • 283
  • 5
  • 13
0
votes
1 answer

Using Bacon.js with FlightJS

Is Bacon compatible with Twitter's Flight? I saw this talk where they are apparently being used together (https://www.youtube.com/watch?v=D0N1NdE-9u0) but couldn't get a minimal example to work. This is my flight component with traditional event…
estolua
  • 676
  • 4
  • 11
0
votes
2 answers

bacon.js - Ignoring certain values in a stream

Assuming the following code (current state can be viewed here): function scrollTopFromEvent(evt) { return $(evt.target).scrollTop(); } function scrollDirection(evt) { return -evt.originalEvent.wheelDelta / 120 || evt.originalEvent.detail /…
Olivier Clément
  • 764
  • 1
  • 8
  • 27
0
votes
1 answer

angular bacon js $scope.digestObservables(observables)

I am using angular bacon in my project. I am using $scope.digestObservables(observables) where observables is the key names of multiple observables. I need to know when all the observables are loaded.
ranjan
  • 351
  • 1
  • 5
  • 16
0
votes
2 answers

Toggling button with Bacon.js

So lets say I have a button #button. I want it to toggle visibility of some element #element. So with plain jQuery I would do $("#button").on("click", function() {$("#element").toggle();}) Or with an explicit side-effect: var visible =…
Dimitri Vorona
  • 450
  • 3
  • 13
0
votes
1 answer

Combine all values of a stream into an array and serve it as a value of other stream?

I have a database query, that returns an array, I convert it to EventStream like so: var stream = Bacon.fromNodeCallback(queryManager, "findAll").flatMap(Bacon.fromArray); And then with each value of the stream, I need to update its properties: var…
dee
  • 23
  • 3
0
votes
1 answer

How to memorize value to use it after flatMap?

Bacon.fromArray(list) .flatMap(function(user){ return Bacon.fromCallback(user, 'getClients'); }) .onValue(function(clients){ // need `user` object some how }) ; Need user object in onValue callback
redexp
  • 4,765
  • 7
  • 25
  • 37
0
votes
1 answer

How can I temporarily "block" an EventStream in bacon.js using another stream?

I'm trying to wrap my head around FRP concepts and build an image slider using bacon.js. I'm mapping the next button's (this is a contrived example btw) click stream like: var position =…
m90
  • 11,434
  • 13
  • 62
  • 112
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: " +…
AlexS
  • 927
  • 4
  • 16
  • 29