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
1
vote
1 answer

Update source and sink dynamically in cycle js?

I'm writing a very simple app using redux-cycle, with 3 elements: A text field to input url A "connect" button to connect to a websocket end point An output panel to show incoming messages I have written a very simple websocket driver based on…
stackoverflower
  • 3,885
  • 10
  • 47
  • 71
1
vote
2 answers

Issue using components in Cycle.js

I'm just getting started with Cycle.js, loving it so far but I'm having some issues componentizing my app. I have this component which I want to import later from an other one: // components/header.js function intent (DOMSource, localStorage)…
keyserfaty
  • 145
  • 1
  • 11
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

Load CycleJS with SystemJS

I tried to load Cycle DOM from their CDN through SystemJS with something like: System.config({ map: { 'cycle-dom': 'https://unpkg.com/@cycle/dom@17.1.0/dist/cycle-dom.js', 'xstream':…
nicholas
  • 14,184
  • 22
  • 82
  • 138
1
vote
1 answer

How to test cyclejs http driver?

Suppose I have an API that return user detail: /api/get_user/1 { "status": 200, "data": { "username": "username1", "email": "username@email.com" } } And a "main function" like this: function main (sources) { const request$ =…
apiep
  • 25
  • 6
1
vote
2 answers

Why can I not use a React Component in a Cycle.js app?

If Cycle uses virtual dom and so does React, then why can I not use React Components inside a Cycle.js app? Would it be possible to use wrap existing React Components into Cycle.js components ? This question relates to : Higher order FRP with React…
jhegedus
  • 20,244
  • 16
  • 99
  • 167
1
vote
1 answer

Cyclejs and trigger events with values

I m trying to learn cyclejs and reactive programming, and I can't get how to manage events with values. For example,I need to create four functions that makes some maths operations such as : addition substraction divison multiplication Here's the…
mfrachet
  • 8,772
  • 17
  • 55
  • 110
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
1
vote
1 answer

Use input field values as part of the data of the HTTP request in CycleJS

I being trying to make a request to a REST endpoint using the CycleJS HTTP driver, but the way I'm getting the values of the input fields is not Reactive, but I'm not being able to find a way to do it (the right way) User case: The user fills the…
ismapro
  • 162
  • 9
1
vote
2 answers

switch/mergeAll/flatten is not a function - while using http driver in cyclejs

I am learning CycleJS and I see that while using Cycle's HTTP Driver, I have to merge the response stream stream using RxJS switch/mergeAll to get to the stream level. But when I try to apply those functions, I'm getting a type error: switch is not…
Vikram
  • 73
  • 8
1
vote
1 answer

Cycle.js Nested HTTP Requests

I'm trying to send multiple HTTP requests using the cycle-http driver. The first request in my example grabs a list of mailboxes and out of that response are multiple mailboxes I have to send HTTP requests for subsequent threads. Get all mailbox…
neurosnap
  • 5,658
  • 4
  • 26
  • 30
1
vote
1 answer

Make an http request on document load using cyclejs

How do I make an http request to a webservice on document load using cyclejs? The examples cover reacting to user input and don't meet my needs.
jdoig
  • 1,472
  • 13
  • 27
1
vote
3 answers

Return JSON Objects instead of JSON arrays with JSON-SERVER

I am using json-server to push json data as REST api. Server returns (above) for get request like this: http://localhost:3000/items?itemid=534 return: [ { "itemid": 534, "type": "textcontent", "icon": "http://exampple.com/1png", …
Emin Hasanov
  • 1,299
  • 1
  • 13
  • 29
1
vote
1 answer

Cycle.js app uncaught type error

I'm trying to learn Cycle.js and must say that I'm finding it quite interesting. I'm trying to create a simple app where I have a input and a ul. Every time write some value to the input and I press enter I want to add a new li with the value to the…
Soham Dasgupta
  • 5,061
  • 24
  • 79
  • 125
1
vote
1 answer

Displaying multiple users from http data instead of a single user

I'm trying to modify the following code so that I receive an array of users from http and display all of them. This code only receives and displays a single user. import Cycle from '@cycle/core'; import {div, button, h1, h4, a, makeDOMDriver} from…
J-Alex
  • 6,881
  • 10
  • 46
  • 64