xstream is a functional reactive stream library for JavaScript. xstream is tailored for Cycle.js or applications with limited use of subscribe.
Questions tagged [xstream-js]
xstream is an extremely intuitive, small, and fast
29 questions
0
votes
2 answers
Storing REST response to indexedDB with Cycle.js
I'm in the middle of learninig Cycle.JS and ran into a challenge. I have a component that will get a result from an HTTP call and I'd like to persist this response in indexDB. However, I feel that the request for persistence is the responsibility of…

Pete
- 3,246
- 4
- 24
- 43
0
votes
2 answers
Cycle.js HTTP response prints as undefined in DOM
I am trying to print the results of an HTTP request to the DOM in Cycle.js. Right now I am just trying to list the results but they will eventually be in a select dropdown.
I create the stream...
const facilityRequest$ = xs.of({
url:…

kyle
- 2,563
- 6
- 22
- 37
0
votes
1 answer
How to send an error from a .map() on an xstream Stream?
Let's say I would like the Stream to emit an error in certain cases:
import xs from 'xstream'
//...
function transformBlah(blah) {
if (blah.status >= 200 && blah.status < 300) {
return blah.body
} else {
return new Error('I…

P Varga
- 19,174
- 12
- 70
- 108
0
votes
2 answers
Dynamic rerouting and circular dependency with Mostjs
It is evident that xstream, with the two methods addListener and removeListener, is able to reroute streams (change their sources and sinks) dynamically. I see no equivalent with mostjs. Does most only let you lay out the routing of the streams…

Joseph Johnston
- 533
- 1
- 3
- 14
0
votes
2 answers
how to power two streams from one DOM event
Form has a Save button. When clicked it supposed to route to another component and save form data. But router$ stream consumes the click event leaving socket$ stream without event to act upon. In the code below saveClick$ only works for router$ but…

Adil Nurtayev
- 1
- 2
0
votes
1 answer
Cyclejs input not resetting after redraw
I tried to create a simple todo app with Cyclejs/xstream. The app works fine. Only thing I not able to understand is after adding each todo the input should clear, which is not happening.
todo.js
import {
div, span, p, input, ul, li, button,…

Soham Dasgupta
- 5,061
- 24
- 79
- 125
0
votes
1 answer
Converting code from Rxjs to xstream
What will be the equivalent of
return Rx.Observable.merge([deleteTodo$, addTodo$, completeTodo$]).startWith([])
.scan(function (currentTodos, modifier) { return modifier(currentTodos); });
the above in rxjs in xstream?

Soham Dasgupta
- 5,061
- 24
- 79
- 125
0
votes
2 answers
cycle.js How to select element from instance of component
With cycle.js I am trying to create a reusable component that can exist multiple times of the page, including event handlers.
When using DOMSource.select it seems to be matching on the entire app container. Is there a way I can .select from only my…
user181351
0
votes
1 answer
Cycle.js: making a multiselect component. Combined stream of option component states doesn't output changed states
Runnable example:
https://esnextb.in/?gist=978799bf48a7f914cbbd39df0213d672
I'm trying to create a multiselect component for cycle.js to see if I want to replace the current UI of an application with a cycle app.
I have one component for the…

UrbKr
- 621
- 2
- 11
- 27
0
votes
2 answers
Cycle.js/xstream click event streamed once, but fired twice
There's a single button element on the page and the following click stream:
let submitClick$ = sources.DOM.select(buttonSel)
.events("click")
.mapTo(true)
.debug(console.log)
Once I click on the button, true is logged, which is…

Svilen
- 2,608
- 24
- 26
0
votes
1 answer
Why does my isomorphic Cycle.js app cause an xstream exception when rendering on server?
I am trying to write a demo isomorphic Cycle.js/Hapi.js app, but it fails with an exception in xstream while rendering on the server. What is going wrong here? I've based my app on Cycle.js' isomorphic app example.
The traceback looks like…

aknuds1
- 65,625
- 67
- 195
- 317
0
votes
1 answer
Dropping button click events until last reset event not working
Using cycle.js and xstream, I would like to count button clicks and reset them.
I was planning to achieve this by counting all button clicks after the last reset. To do this I thought of dropping all button clicks until the last reset, and counting…

Chad
- 2,041
- 6
- 25
- 39
0
votes
1 answer
why I can't combine streams using xstream in cyclejs?
I'm being trying unsuccesfully to combine to streams into one, and show the text in a h1.
But not being able to make it work:
this is my code:
function main(sources) {
// single streams
let letter$ = xs.of({text: 'abcd'});
let number$ =…

ismapro
- 162
- 9
-1
votes
1 answer
How to stop stream from ending
How to stop the take method from ending nested streams, to be used with flatten?
Is there some other solution to nested streams? I tried merging fromDiagram without end symbol, but apparently that doesn't work.

janat08
- 1,725
- 2
- 16
- 27