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
8
votes
2 answers

How to request data sequentially in Cycle.js?

I’m new to reactive programming and toying around with cycle.js, trying to implement who to follow box from this tutorial. But I understood that for proper implementation (and learning purposes) I don’t have one piece of data: full user name. I can…
alice kibin
  • 572
  • 1
  • 4
  • 18
5
votes
1 answer

Running js code after all dom rendered in Cycle.js

I want to use Foundation's reveal plugin to display a nice modal in a Cycle.js app. After playing with Webpack and it's configuration for hours, I figured how to propertly import foundation's js into my (es6) app. However, since I'm dealing with…
5
votes
3 answers

How do I focus an input with Cycle.js and RxJS?

How do I focus an input with Cycle? Do I need to reach inside the DOM and call .focus() either with or without jQuery, or is there some other way with Cycle/RxJS?
Ilya
  • 143
  • 1
  • 14
4
votes
2 answers

How to concat to sources?

I have the following code: const Cycle = require('@cycle/core'); const {Observable} = require('rx'); function main(sources) { const B$ = sources.driverA .concat(Observable.just('b')) .concat(Observable.just('c')); const C$…
dypsilon
  • 150
  • 6
4
votes
1 answer

How to catch keyboard events in Cycle.js?

I'm trying to get hold of when the user presses the Escape key with my app open (so not necessarily with an input field focussed). So far, however, I'm stuck at intercepting keyboard events at all. This is what I'm currently…
Vincent
  • 4,876
  • 3
  • 44
  • 55
4
votes
2 answers

How to handle authorization token

I would like to add auth token to http request header every time a http request sent and if authorization fails, I want to redirect user to the login. Should I decorate Http Driver or is there a better way to do it? I came with a solution that…
erdal
  • 421
  • 3
  • 10
4
votes
2 answers

Can't seem to find resources about testing a Cycle.js app

I have been trying to search for guide about testing a Cycle.js app but couldn't seem to find one. Can someone please point me to a guide or provide some examples?
doodledood
  • 407
  • 4
  • 12
3
votes
1 answer

Fold with initial value from localStorage in CycleJS

I am making an emoji viewer app with cycleJS, where the user can click on any emoji to add/remove it from their list of favorites. The list is also saved to localstorage on every change. I'm constructing the list using xstream by folding the click…
Lev Izraelit
  • 512
  • 4
  • 14
3
votes
1 answer

How insert html into iframe with CycleJS

With vanilla JavaScript, I would do the following to add an h1 tag to the iframe body: var doc = document.getElementById('iframe').contentWindow.document; doc.write('

Hello

'); How can I do this with CycleJS?
Nurlan Mirzayev
  • 1,120
  • 1
  • 7
  • 15
3
votes
2 answers

How to abort calls made by @cycle/http driver?

I'm pretty new to the whole Cycle.js/RxJS ecosystem and was hoping for someone to guide me on the process of aborting an ongoing ajax call since it looks like doable somehow. It would be awesome to have a little example forked from the…
coma
  • 16,429
  • 4
  • 51
  • 76
3
votes
2 answers

RxJS: Handing errors in cycle.js custom driver

I have implemented some error handling code in my main function as below. It uses the catch operator to filter and report on errors in one stream and ignore them in another. This allows me to know about and report on errors that occur with requests…
djskinner
  • 8,035
  • 4
  • 49
  • 72
3
votes
1 answer

Loading json data into CycleJS app

I'm trying to wrap my head around CycleJS but I'm stuck! I'm trying to put a small app together that loads a JSON file containing an array of objects, but I can't get the app to execute the http request Here in my code so far 'use…
kristian nissen
  • 2,809
  • 5
  • 44
  • 68
3
votes
1 answer

Does Cycle.js (virtual-dom) support anything like React's refs or mithril's config property?

In other words, is there any way to access a DOM element after it is rendered? Things like mouse focus, code highlighters, animations, how are they done in Cycle.js?
kliron
  • 4,383
  • 4
  • 31
  • 47
3
votes
1 answer

How can Cycle code be broken up for creating large applications?

I have gone through the official and other documents about Cycle.js The only point I see is that it separates the main logic and their effects on DOM. The examples given are very short like building a BMI calculator. I don't understand how…
Lakshay Dulani
  • 1,710
  • 2
  • 18
  • 45
3
votes
2 answers

How to use Cyclejs with external template

I want to start my first Cycle.js project and I will develop it in conjunction with a friend. He is an HTML designer (knows a lot about HTML and CSS, and he creates Handlebars templates) and I know a bit about JS. I would like to know if there are…
Mictian
  • 107
  • 4
1
2 3 4 5 6 7 8