Questions tagged [kefir.js]

Kefir is a Reactive Programming library for JavaScript inspired by Bacon.js and RxJS, with focus on high performance and low memory usage.

Kefir is a Reactive Programming library for JavaScript inspired by Bacon.js and RxJS, with focus on high performance and low memory usage.

Homepage: https://rpominov.github.io/kefir/

16 questions
12
votes
2 answers

What are the differentiating features between Highland.js, Kefir.js, and Rx.js?

Since subjective answers are to be avoided on SO, I'm specifically asking: What are the functional and/or performance differences between these three functional/reactive libraries that would make me choose one of them over the others? I have…
Ville
  • 3,657
  • 1
  • 32
  • 36
5
votes
2 answers

Ignore events on stream until condition is satisfied?

I created a stream from button click events. The button corresponds to a create action on the database. Obviously, I want the database action to fire only once (at least until it completes). Is there a way to ignore events on createButtonStream…
U Avalos
  • 5,553
  • 6
  • 38
  • 67
3
votes
2 answers

Stream of arrays into array of streams operator

In Rx.js, how to turn a stream of arrays into array of streams for example i have a stream of following:['0a','0b'], ['1a','1b'],['2a','2b','2c'] and i want to get the following streams: 0a---1a---2a---> 0b---1b---2b---> 2c---> Are there…
2
votes
1 answer

How should I trigger an XHR on component MouseClick using CalmmJS and React?

What I want is to trigger an XHR.perform onMouseClick, using CalmmJS and React - I'm trying the following code, unnecessary parts redacted: const getResults = someArg => XHR.perform({ timeout: 60 * 1000, responseType: 'json', method:…
JimmyM
  • 357
  • 3
  • 17
2
votes
1 answer

Calmm-way of doing async requests with interval?

What's the most elegant way (in Calmm stack, Kefir, Karet Utils etc.) of doing repeated (infinite) async jobs with interval? I want to get some json every 2000ms. Example 1 (2000ms interval): Fetch json (get takes 100ms) Handle json Wait the…
2
votes
2 answers

Pass data to React component with kefirjs

I am new in ReactJS and "reactive programming". I tried to create a dispatcher, action and store according to this project, but I don't know how to pass data to component. In this example it doesn't work. var data = [1, 2, 3, 4, 5]; var…
Matt
  • 6,793
  • 24
  • 89
  • 169
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
  • 72,750
  • 22
  • 137
  • 214
1
vote
1 answer

exponential time and inconsistent transient values when pushing a value in reactive programming?

I'm fairly new to reactive programming, and I'm starting to play with kefirjs. On the face of it, it looks like bacon/kefir's event streams and properties are essentially a way to express a dependency/computation dag that varies with time, and there…
Don Hatch
  • 4,224
  • 3
  • 22
  • 41
1
vote
1 answer

Capture all key inputs until ENTER is hit in a reactive programming way

In Javascript and using Kefir, I'd like to capture all key inputs until ENTER is hit. So far, I've managed to do this using bufferWhile like var inputValues = Kefir .fromEvents(document.querySelector('body'), 'keydown') .bufferWhile(event =>…
VH-NZZ
  • 4,782
  • 3
  • 26
  • 43
1
vote
2 answers

Ignore/cancel/interrupt streams in Functional reactive programming?

Is there a way to cancel/ignore/interrupt a stream based on the output of another stream? The use case is that I have 3 streams: loginStream - user enters login creds and clicks submit. Emits login creds. authorizeStream- system tries to authorize…
U Avalos
  • 5,553
  • 6
  • 38
  • 67
1
vote
1 answer

Do I need to unsubscribe a listener to stream that ends in Kefir?

I'm moving from BaconJS where this isn't an issue because you can just return Bacon.noMore in the subscriber to unsubscribe. In Kefir, unsubscribing is more boilerplate and so the natural question is---for streams that end, do you need to…
U Avalos
  • 5,553
  • 6
  • 38
  • 67
0
votes
0 answers

Could someone explain to me what does kefir do in this code?

I just started working with WebSockets and stumbled upon this code. It seems that I can't figure out what exactly does kefir (stream function) do? I understand it is something like rxjs but not entirely? Could someone explain this to me? :D Thanks a…
0
votes
1 answer

EventEmitter vs RxJS vs Kefir

I wanted to compare JS EventEmitter and RxJS performance. I wrote following benchmark script to do that: Performance Test import Rx from 'rxjs/Rx'; import Kefir from 'kefir'; import { EventEmitter } from "events"; let Benchmark = require…
pntripathi9417
  • 248
  • 1
  • 11
0
votes
1 answer

Kefir.js drag example - drag end

I've been trying to factor a drag end stream / observeble into the Kefir drag div example but am not getting anywhere. Firing an event after a combination of mousedown, mousemove and mouseup would seem to make sense, but I just can't find a way to…
jsleeuw
  • 251
  • 5
  • 12
0
votes
1 answer

Stream processing in Kefir/Bacon.js

I have been working on a personal project involving real time data using Kefir (or Bacon.js, pick your favorite) and have gotten to a point where I need to log the data in a database to append an id, and then pass the object with the id down the…
codeape
  • 348
  • 1
  • 12
1
2