Questions tagged [frp]

Functional reactive programming is programming paradigm for reactive programming

451 questions
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
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,999
  • 4
  • 30
  • 38
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,999
  • 4
  • 30
  • 38
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,928
  • 1
  • 26
  • 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
  • 191
  • 1
  • 3
  • 8
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,892
  • 1
  • 20
  • 28
0
votes
1 answer

Sodium event updates not being reflected

So I'm trying to understand how Sodium's model for functional reactive programming works, and I'm running into some snags. I have a list of numbers that I'm updating with a "Time" like value, and I'm adding to this list when space characters are…
chanko08
  • 284
  • 1
  • 10
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,824
  • 4
  • 26
  • 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,448
  • 14
  • 24
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
  • 3,407
  • 5
  • 44
  • 74
0
votes
2 answers

Connecting a Netwire network to OpenGL/GLUT Callbacks

As an experiment, I have set up a simulated set of gears attached to a motor and rendered them with OpenGL/GLUT. At the moment the only input to the Wire network is Time. I want to use the keyboard to control the change the speed of the motor. I…
John F. Miller
  • 26,961
  • 10
  • 71
  • 121
0
votes
1 answer

Functional Banana Traveller - Input Handling

This is a sub-problem from my Traveller project. I've put together the rudementary code that will handle input. It works, until I introduce a TChan to the mix. Below is the working code, with an example of how to use it. Then, I will change it and…
user1198582
-1
votes
1 answer

Function that returns one of its argument

I heard it in a podcast, that, there is a function which takes two args, and returns one of them, and it doesn't tell you which one. What's the name of this function? That podcast is about functional reactive programming, and the host itself created…
Not an ID
  • 2,579
  • 2
  • 21
  • 28
1 2 3
30
31