Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Dmitrii 'Mamut' Dimandt
@dmitriid
:D
Vincent Orr
@Cmdv
was the sound not good?
I missed it
Vincent
@Vinnl
Did you not have an echo? Perhaps it's a problem in my setup
Vincent Orr
@Cmdv
I caught the very last minute and it seemed very quiet
Vincent
@Vinnl
Odd...
Anyone know how I can render a VTree to a string?
Michal Vanko
@michalvankodev
try JSON.stringify.. VTree should be just bunch of objects
Vincent
@Vinnl
Ah, sorry, I should clarify: I want a string containing the HTML representation of the virtual DOM :)
And perhaps to avoid the XY problem just mentioned in the presentation: I want to test the view without needing to know the exact structure. Thus, my thinking was that if I could render it to an HTML string, I could use Cheerio (JQuery-like) to find an element in the rendered view.
Brandon Smith
@BrandonSmith
Vincent
@Vinnl
@BrandonSmith Ah, a separate module. That works perfectly, thanks :)
Vincent Orr
@Cmdv
great talk @Widdershin I was thinking out of the box, if there's a way cycle-restart could be used to stack trace to help debug where streams went wrong.
damn that's when I wish I was there in person so I could ask multiple things haha
André Staltz
@staltz
SUPER talk by @Widdershin
Marius Lundgård
@mariuslundgard
I really wish the @cycle/http module was called @cycle/xhr or something in that vein. Which could open the @cycle/http for a HTTP req/res driver for Node. What do you think?
André Staltz
@staltz
hmm, because Cycle is mostly for the frontend, you could consider http-node driver
Vincent Orr
@Cmdv
totally forgot to mention I updated the socket.io driver!! need to get it out to npm unless you want it as part of Cycle @staltz ? https://github.com/Cmdv/cycle-socket.io
André Staltz
@staltz
I'll review it :+1: probably soon after the conf
André Staltz
@staltz
How to use Cycle with xstream: cyclejs/examples@9c6e992
Vincent Orr
@Cmdv
:sparkles:
Dmitrii 'Mamut' Dimandt
@dmitriid
\o/
André Staltz
@staltz
xstream might still be buggy, report bugs if you find
Steve Lee
@SteveALee
my slides from cycleconf Lightning talks - "Cycling for noobs" http://www.slideshare.net/SteveLee/cycling-for-noobs
Alex
@whitecolor
I just passed though slides, and when I read "designed for people with cognitive disabilities" I clearly realized that the presentation is about cycle and rx stuff
fiatjaf
@fiatjaf
what is Cycle Diverse?
André Staltz
@staltz
The next big version of Cycle supporting RxJS v5, most.js and xstream
David Schalk
@dschalk
A persistent, shared todo list; a websockets game; chat rooms and more running flawlessly (as far as I can tell ) in a Motorcycle.js application. The repo is at JS-monads-part6 and the online demonstration is at http://schalk.net:3055. There are two major cycles involved in the application. Motorcycle.js is one. The other is processed user input going to the modified Haskell Wai Websockets server and then being received (sometimes after server processing) by group members for parsing and updating the virtual DOM . My JS-monads are in a mature state now, and are very helpful in running the application in an understandable, easily maintainable, reactive manner. I feel so relaxed and and unburdened now that React.js and Node.js are becoming distant memories.
Marcus Nielsen
@marcusnielsen
@mariuslundgard how do you think a req/res feedback cycle should work? I think websockets are a better natural fit than http req/res.
Dmitrii 'Mamut' Dimandt
@dmitriid
@SteveALee Awesome presentation. Brain aches, wants and possible bugs hit close to home :)
Steve Lee
@SteveALee
@dmitriid thanks. Good to know it's not just me! :)
byt the way another big win of XStream is .do(x=>console.log(x)) -> .debug(x) ftw
André Staltz
@staltz
It's actually .debug() :) even easier
Alex
@whitecolor
btw I use my https://github.com/whitecolor/rx-log for the same purpose xxx$.log('xxx').map(...
Marius Lundgård
@mariuslundgard
@marcusnielsen I have a work-in-progress req/res driver https://github.com/mariuslundgard/cycle-http-context-driver/blob/develop/src/http-context-driver.ts. It's similar to how RPC works using a message queue (in that it passes the response around for correlation).
And used like this in a component:
import {HTTPContext} from '../../http-context-driver'

function FrontPage ({HTTP}) {
  return {
    HTTP: HTTP.map((ctx: HTTPContext) => {
      const outgoing: HTTPContext = {
        request: ctx.request,
        response: ctx.response,
        body: 'FrontPage'
      }

      return outgoing
    })
  }
}

export default FrontPage
I'm not sure it's a perfect fit for req/res, however I find it nice to be able to deal with req/res in a similar manner as the rest of the app.
Marcus Nielsen
@marcusnielsen

@mariuslundgard awesome! You got a github star :-)
I hope I can start wrapping https://github.com/marcusnielsen/rxjs-server as a cycle.js driver in the future. And I would love to have the req/res-part available as well.

I just don’t have the time to figure out if I need cycle.js or not in my projects. But I do use most of the thoughts I’ve heard about MVI, but as model, view, interactions, and state.

where interactions are actions (input functions), events (output event streams), and reactions (chaining composed events).
Raquel Moss
@raquelxmoss

Does anyone have any ideas on how to listen for keypress events on the entire app, without adding an input for the user to type into?

The following works for mouse clicks, but not keypresses.

input$ = DOM.select(':root')
  .events('keypress')
Daniel Hodan
@czertbytes
select on document
i mean try, input$ = DOM.select(document).events('keypress')
Raquel Moss
@raquelxmoss
Looks like that's not allowed: render-dom.js:206 Uncaught Error: DOM driver's select() expects the argument to be a string as a CSS selector
Which makes sense to me...selecting document feels a bit weird.
Daniel Hodan
@czertbytes
sorry for confusion ;) my fault, i used https://github.com/TylorS/cycle-snabbdom/blob/master/src/fromEvent.js#L37 and it worked for me ;(
Raquel Moss
@raquelxmoss
Ah right, thanks! I might try that at some point, for now I'll just add an input
Daniel Hodan
@czertbytes
okay, my last "help" const input$ = Rx.Observable.fromEvent(document, 'keypress'); works for me
Tylor Steinberger
@TylorS
Hey @czertbytes You usually don't want to do that type of thing inside of main(). You'd generally want to make that driver.
Cycle.run(main, {
  keypress$: () => Rx.Observable.fromEvent(document, 'keypress')
})
The reason DOM.select() doesn't select from document, is because it's external to your main(). Drivers are the place where you listen to what is external to your main().
Daniel Hodan
@czertbytes
hi @TylorS , right, thanks ;)