Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Jan van Brügge
@jvanbruegge
also makes it easier to introduce in client projects, because you say it is react with cycle instead of redux/mobx/whatever and that's usually fine
but suggest using anything other than react and people scream that they won't be able to find developers
PEZO
@ZoliPeto_twitter
What I am trying now is RN + Redux + Redux-cycles. That seems one level more accessible.
@jvanbruegge @staltz is there a standard way to normalize data in cycle like https://redux.js.org/recipes/structuring-reducers/normalizing-state-shape ? If there is not what is your solution for it?
Jan van Brügge
@jvanbruegge
i have shared data on the lowest common level and then propagate it with lenses
PEZO
@ZoliPeto_twitter
Thanks! Wdyt about state normalizing like https://www.npmjs.com/package/normalize-ts ?
Jan van Brügge
@jvanbruegge
simply not needed IMO
PEZO
@ZoliPeto_twitter
Thanks.
David Skuza
@davidskuza
Hello everybody :)
Does anybody know if current version of cycle/dom works with TS 4? Or rather if it does not
Jan van Brügge
@jvanbruegge
it should work
PEZO
@ZoliPeto_twitter
Can anyone show me real world uses of Time.diagrams in tests? I really do like the idea, but I fint it hard to read and write more complex tests of main functions eg. with assertions on State as well, am I misusing it? If its only for less complex cases then I see it’s point, but for longer integration test like use cases it seems to be cumbersome.
Matthew Hayden
@mrehayden1
I seem to remember a function that someone had developed that transformed streams of form inputs into useful streams, like validation errors etc
I find myself writing the same pattern over and over when doing forms, just wondered if anyone had developed some code to save time before I try to.
Géraud Henrion
@fuunnx
something like that ?
let formState$ = DOM.select('form').events('input')
  .fold(
    (state, event) => ({
      ...state, 
      [event.target.name]: event.target.value
    }), 
    {}
  )
with
let errors$ = formState$.map(validate)
Matthew Hayden
@mrehayden1
I guess that gets rid of a lot of boilerplate!
Géraud Henrion
@fuunnx
:)
Matthew Hayden
@mrehayden1
I wonder how much further it could we taken and still be useful? Maybe it could return stream that only returns a submission when there are no validation errors. Maybe it could be a component that submits to HTTP endpoint and merges in the server side errors.
Instead of collecting up the inputs like you did, I tend to serialize the form object on the submit event.
Géraud Henrion
@fuunnx
probably yes, depending on your needs
Matthew Hayden
@mrehayden1
I've noticed a slightly odd thing with cycle state and switching components. The state stream won't produce in an isolated component unless there is an explicit lens set.
Judson Lester
@nyarly
I just spun up a one-fits-all app, and npm start fails with ValidationError: Invalid options object. Sass Loader has been initialized using an options object that does not match the API schema.
Matthew Hayden
@mrehayden1

I just spun up a one-fits-all app, and npm start fails with ValidationError: Invalid options object. Sass Loader has been initialized using an options object that does not match the API schema.

I think you're possibly using webpack 5? I think I had the same issue. If not try the issues on the one-fits-all repo, I found the solution eventually.

Jan van Brügge
@jvanbruegge
yeah, the config was for webpack 4 and has not been updated
I plan to archive create-cycle-app because IMO a repository template would be a better and easier starting point (no magic)
Also unrelated: My blog post about by open source journey was published today: https://futurice.com/blog/my-open-source-journey
Matthew Hayden
@mrehayden1
Calling for more CVs for people interested in remote cycle.js work. Office hours are 9-5GMT.
1 reply
DM me if interested.
Judson Lester
@nyarly
After some distraction, I'm looking back to a toy cycle.js app. I spun it up with cycle-create-app, but it's only kind of working, and my "hello world" addition isn't running at all.
Notably, running the vanilla demo, it redirects to /counter, and that works fine. But reloading the page remains on /counter - but nothing happens.
I set up a very small component that maps the State to a small DOM fragment and changed the redirect to point at that, and it likewise results in a white page.
Debugging, it looks like replicateMany gets run on the sources and sinks... and then nothing.
Judson Lester
@nyarly
Maybe this is related to webpack 4? I haven't been able to figure out how this would work at all...
Géraud Henrion
@fuunnx
weird ! sometimes it's a silent error, try adding listeners to your sinks with : sink$.debug('sink').addListener({ error(e) { throw e } }) and see if something happens
Judson Lester
@nyarly
I can try that - but it looks like the sinks never get called. I'm fiddling with my dev setup so that I can do npm run build and look at that instead of npm run
Matthew Hayden
@mrehayden1
@nyarly maybe they're producing before anything is listening
are you switching components dynamically?
Judson Lester
@nyarly
No.
Géraud Henrion
@fuunnx
Is your component called ? do console.log('hey') gets called if you put it in the body of your component ?
Are other components called ?
Judson Lester
@nyarly
Sometimes. I need to get back to debugging it.
Rajasegar Chandran
@rajasegar
Have anybody tried bundling a cycle.js app using rollup? Is there a sample repo/code to look into?
Géraud Henrion
@fuunnx
I did not, but I would say any javascript code, cyclejs or not should work the same, or is Rollup so different than other bundlers ?
SouravBiki
@SouravBiki
Ok
I have requirement of showing some data on the page on load. The data will come from httprequest. There will be another button. Clicking that button will show some other data coming from another httprequest. I am unable to do it. Initially the data is not shown on the page althoughv httprequest is getting fired. But button clicks work fine. How can I do it? Can you send me a code sample?
SouravBiki
@SouravBiki
You can find my code at cyclejs-community/awesome-cyclejs#113 and probably can show me a direction
Géraud Henrion
@fuunnx
Rajasegar Chandran
@rajasegar
Hi , I am new to Cycle.js, I am trying to build the 7GUIs CRUD example with Cycle, struggling with implementation in a purely reactive way, appreciate any help https://github.com/rajasegar/cycle-crud
https://eugenkiss.github.io/7guis/
Géraud Henrion
@fuunnx
Hi, first advice, you should separate your persistent state (the data that could be persisted in a database, your source of truth, here : the list of all people) from the derived state (the data that is displayed, here your filtered list)
Also, you should use the propsmodule instead of attrs to update your inputs values. Here some explanations of the differences between attributes and properties : https://stackoverflow.com/a/53924373/6125124