Questions tagged [cyclejs]

CycleJS is a fully reactive JavaScript framework for Human-Computer Interaction

Cycle.js: a functional and reactive JavaScript framework for cleaner code.

Your app and the external world as a circuit:

Your app and the external world as a circuit:

Cycle’s core abstraction is that your application is a pure function: main(). A function where inputs are read (sources) from the external world and outputs (sinks) are written to the external world. These side effects in the external world are managed by drivers: plugins that handle DOM effects, HTTP effects, and other side effects.

The internals of main() are built using Reactive programming primitives, which maximize the separation of concerns, providing a clean and fully declarative way of organizing your code. The dataflow is plainly visible, making it easy to read and understand the code.

Read more at cycle.js.org.

117 questions
0
votes
1 answer

CycleJS Collection returning old data

I'm trying to recreate RxMarbles for RxJS 5, but I'm having feedback problems when I change the collection's data (specifically the length of the data source). I added console.logs for debugging Note for those who are familiar with RxMarbles, I…
Alan
  • 297
  • 3
  • 12
0
votes
2 answers

In Cycle.js Collections, how does the second sources stream relate to the first?

In the following example (from the Collections README), it sounds as though the third argument is acting as a filter: function TodoList (sources) { const addTodo$ = sources.DOM .select('.add-todo') .events('click') .mapTo(null); // to…
bbarker
  • 11,636
  • 9
  • 38
  • 62
0
votes
1 answer

How do you enable rendering of attributes in Cycle.js/dom?

I have the following snippet: button('.textbutton', { type: "button", onclick: `toggleVisibility('#abs-${submission.submission_id}');` }, 'Abstract' ), a( {href: "https://localhost:8080"}, 'View…
bbarker
  • 11,636
  • 9
  • 38
  • 62
0
votes
1 answer

Cycle.js stream composition to ensure single AJAX requests

I'm building an infinite scroller in cycle.js. I have an ajax service that returns X results per page. The first request is with a page id of 0, but subsequent requests need to use the page id returned in the first result set. The results are…
rje
  • 390
  • 2
  • 8
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
2 answers

how to intergate eventemitter3 in CycleJs

pixijs use eventemitter3 for handler sprites events. for example sprite.on('mousedown', onDown), i am wondering how to make a driver in order to handlering events listening sprites.can any one show me some point?
蓝梓文
  • 1
  • 1
0
votes
1 answer

Create elements dynamically with CycleJS

I'm trying to learn some CycleJS and I ended up not knowing what to do exactly with this. The goal is to create inputs via configuration, instead of declaring them manually. The problem is I'm only getting rendered the last of the inputs from the…
Trajan
  • 370
  • 1
  • 2
  • 8
0
votes
1 answer

Handling JSON Objects in RxJS

I am new to cyclejs and rxjs in general and was hoping someone could help me solve my problem. I am trying to build a demo application for my understanding and stuck with rendering JSON objects on the DOM. My demo application calls the NASA near…
Tanmay
  • 341
  • 2
  • 6
  • 22
0
votes
1 answer

How to use cookie driver for CycleJS

I have to save token in cookie of browser (in my case Chrome). I found https://github.com/10clouds/cyclejs-cookie this resource and installed version 0.5.0. When I set something to cookie I receive this kind of error: _cookie_js2.default.set is not…
Nurlan Mirzayev
  • 1,120
  • 1
  • 7
  • 15
0
votes
1 answer

What is the best way to get the viewport size in a Cycle.js app?

I'd like to create a stream that passes viewport size [height, width] event for a Cycle.js app using SnabDom and MostJS. It looks like installing an insert hook on the :root div to get at the vDOM.elm properties should work, but so far no joy. …
Tim Smith
  • 1
  • 1
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