Questions tagged [xstream-js]

xstream is a functional reactive stream library for JavaScript. xstream is tailored for Cycle.js or applications with limited use of subscribe.

xstream is an extremely intuitive, small, and fast
functional reactive stream library for JavaScript

  • Only 26 core operators and factories
  • Only "hot" streams
  • Written in TypeScript
  • Approximately 30 kB in size, when minified
  • On average, faster than RxJS 4, Kefir, Bacon.js, as fast as RxJS 5, and slower than most.js
  • Tailored for Cycle.js, or applications with limited use of subscribe

Read more on GitHub.

29 questions
5
votes
0 answers

TypeScript: How to extend type definitions of a npm module?

In the TypeScript handbook is this example for declaration merging: // observable.js export class Observable { // ... implementation left as an exercise for the reader ... } // map.ts import { Observable } from "./observable"; declare module…
maiermic
  • 4,764
  • 6
  • 38
  • 77
2
votes
1 answer

RxJs zip operator equivalent in xstream?

Hello I'm trying to figure out if there is an equivalent to the RxJs operator zip in xstream, or at least a way to get the same behaviour. In case anyone needs clarification on the difference the marble diagrams below will show. zip in rxjs …
pbie42
  • 605
  • 1
  • 6
  • 12
2
votes
1 answer

Getting the API error response from CycleJS HTTPDriver

I'm trying out CycleJS with xstream and I can't find a way to both rescue an error (e.g. 422) and get the JSON response from the HTTP driver. To rescue from an error, I'm using xstream's replaceError which seems to work like this: sources.HTTP …
Svilen
  • 2,608
  • 24
  • 26
2
votes
2 answers

List and Isolate 3 Items in Cycle.js

As a newbie i am trying to make List with 3 Items in Cycle.js. But code has bugs. I made jsbin and placed code below as well http://jsbin.com/labonut/10/edit?js,output Problem: when i click on last checkbox, it adds new checkbox (which i did't…
Vladimir Buskin
  • 614
  • 4
  • 8
1
vote
0 answers

How to match dependent events in FRP (in event streams)?

I’m looking for a pattern, not sure if it exists. I am working with xstream and I encounter this problem lately. I want to MATCH events based on their causation/dependency on each other. Let’s say E1 (in Stream1) and E11 (in Stream11) caused E2 (in…
1
vote
1 answer

second merged branch ignored in XStreams

I'm working on a Cycle JS app using storage and state plugins. The app use xstream as reactive library. I'm incapped in a strange behaviour. My streams are as this diagram On first session var update I got this debug result: debug 0 debug 1 debug…
Fabiano Taioli
  • 5,270
  • 1
  • 35
  • 49
1
vote
1 answer

Unable to stream events within a mocked DOM source in CycleJs test

Given an isolated component built with CycleJs (the component works fine) : import isolate from '@cycle/isolate'; import { div, ul, li, a } from '@cycle/dom'; function intent(domSource){ const changeString$ = domSource …
krampstudio
  • 3,519
  • 2
  • 43
  • 63
1
vote
1 answer

how do I get xstream to combine mouse events?

I'm experimenting with drag-and-drop using cyclejs in a codepen. The standard drag methods supported by HTML 5 don't seem to support constraints on the movement of the dragged object so I went with standard mousedown/mousemove/mouseup. It works, but…
James Fremen
  • 2,170
  • 2
  • 20
  • 29
1
vote
2 answers

How to order stream merges?

I would like to merge two maps of the same source guaranteeing the order of the result. Here is a unit test that I would like to pass: const source = xs.of(1,2,3) const a = source.map(v=>v*10) const b = source.map(v=>v*100) const…
Bijou Trouvaille
  • 8,794
  • 4
  • 39
  • 42
1
vote
2 answers

Cyclejs and xstream not displaying anything

I m trying to create a stream from an array logging inside of its map operator but it seems that something goes wrong in my code and I can't point it out... import {Slider} from './slider/slider' import xs from 'xstream' export function…
mfrachet
  • 8,772
  • 17
  • 55
  • 110
1
vote
1 answer

Emit a stream only if value changed

Using xstream, how can I create a stream that only emits when it's input stream emits a new value Here is a diagram input -----1--1-1--2-3--3--3---5-| output -----1-------2-3---------5-|
Ernest Okot
  • 880
  • 3
  • 8
  • 23
1
vote
2 answers

How to reset form fields to default value in cycle.js

I have a piece of code, using cycle.js and the reactive xstream library, like the one shown below. It consists of a form field whose value is rendered in a p tag on submit. The questions follow: 1. How can the form's input field be reset to the…
7puns
  • 1,505
  • 1
  • 9
  • 9
0
votes
1 answer

What is the XStream imitate use case

The docs go over imitate use case, but I don't understand the example made. Where would you call a Parent function, is it like recursive? I'd like to see what the model function looks like, and what the child gets out of it.
janat08
  • 1,725
  • 2
  • 16
  • 27
0
votes
1 answer

how do I rendering multiple components using xstreamjs

Suppose, I want to render 3 buttons which are mapped from Array export const homePage = soruces => { const array$ = xs.fromArray([1,2,3]) return { DOM: array$.map(e => { return
Patrick
  • 734
  • 11
  • 26
0
votes
1 answer

Cycle.js: Getting Stream, Expecting Blob

I'm trying to create a record audio stream. I'm creating a promise stream from navigator mediaDevices.getUserMedia then mapping that stream to a media recorder stream. Finally I want to create a blob stream with the media recorder stream. What I'm…
PAT-O-MATION
  • 1,907
  • 1
  • 20
  • 20
1
2