Questions tagged [frp]

Functional reactive programming is programming paradigm for reactive programming

441 questions
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
  • 677
  • 4
  • 11
0
votes
1 answer

Observing sub-class properties in Swift (Reactive Cocoa)

I am new to Reactive Cocoa and to be honest it's not as simple to get into FRP as I thought it would be. Anyway, the concept is awesome and I'm trying to implement RAC in my current Swift project. The situation: MainTableViewController sets a…
flocbit
  • 313
  • 2
  • 10
0
votes
2 answers

Two sequential HTTP requests

Sorry for newbie's question (and for my english) :) I tries to write the following function: the function downloads a content from URL1 (it's received as argument) the function parses this content and extract URL2 the function downloads a content…
vasalvit
  • 143
  • 1
  • 4
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
  • 732
  • 1
  • 7
  • 26
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
  • 10,334
  • 11
  • 53
  • 105
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

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…
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…
FredyC
  • 3,339
  • 2
  • 26
  • 36
0
votes
1 answer

How does BeanProperty.create work?

I'm trying to get beans binding to work, because it seems like the closest thing to functional reactive programming I can get NetBeans GUI builder to give me. I'm trying to understand how the code in…
Jason Gross
  • 5,363
  • 1
  • 21
  • 53
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…
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…
haknick
  • 1,862
  • 1
  • 20
  • 28
0
votes
1 answer

How to deal with flapjax EventStreams which becomes unused

I want to create an event stream which fires events whenever a user has touched and moved his finger by some pixels. Event should contain the relative x and y value by how much the user has moved. The following code does it correctly: …
triggeray
  • 1
  • 2
0
votes
1 answer

Simple Example for Scala React

Based on the paper Deprecating the Observer Pattern with Scala.React I tried to set up a simple example from the paper, but it throwed an exception Exception in thread "main" java.lang.AssertionError: assertion failed: This method must be run on its…
Peter Schmitz
  • 5,734
  • 4
  • 24
  • 48
0
votes
1 answer

Signalr - Serialize callback as event not a function call?

In Signalr, is there any support for having events instead of callbacks. Let me explain before you grab your pitchforks. In following with the first example here Clients.All.addContosoChatMessageToPage(name, message); Wouldn't call a hub proxy's…
Brian Rosamilia
  • 1,348
  • 11
  • 21
0
votes
1 answer

lambdas and their captured values

I've just been doing some experimenting recently with functional reactive programming and what it is, and when i was trying to implement something like it in c++, i turned to the lambda for some help. I came up with the beginnings of something like…
FatalCatharsis
  • 2,938
  • 3
  • 35
  • 59
1 2 3
29
30