Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Tylor Steinberger
@TylorS
Let me open an issue for that
Michal Vanko
@michalvankodev

@TylorS

cyclic-router isn't ready for conversion though :(

NOooooooooooooooooo

Tylor Steinberger
@TylorS
I want to rewrite it in TS and XStream
Definitely high on my todo list
Michal Vanko
@michalvankodev
Thank you.. My todays journey is therefore in the end.. If there is any way to help you I'd like to :)
Tylor Steinberger
@TylorS
If you'd like to submit a patch for simple conversion before it gets rewritten that'd be very welcomed, but I don't expect it from anyone. Not many people are familiar with how to do the conversions inside of drivers just yet
Michal Vanko
@michalvankodev
What is your estimate for a rewrite?
I can perhaps help you with that
Tylor Steinberger
@TylorS
I'm trying to get a tangible POC of a library I'm writing right now (probably by the weekend), then my priorities are most-run and most-adapter (mostly done), and then converting all of my existing libraries.
André Staltz
@staltz
It's rather easy to make a driver ready for Cycle Diversity
Really, it's
function makeMyDriver(lol) {
  function myDriver(sink) {
    // ...
    return source;
  }
  myDriver.streamAdapter = RxAdapter; // <=== this
  return myDriver;
}
Michal Vanko
@michalvankodev
nice going to try it out :)
André Staltz
@staltz
So try that out and make a PR to cycle/history if that's the case
Michal Vanko
@michalvankodev
of course :) going to relax a bit
and then i will take a look at it.. looks really simple
Laszlo Korte
@laszlokorte
@staltz doesn't sink need to be converted by the driver as well?
Oh, never mind, cycle does that automatically, right? but nested streams need to be converted manually?
Andrey
@frontendthug

hello, guys! i'm just start to play with cyclejs, and when i try to run simple examples, like checkbox, i'm always get error like:

this.runStreamAdapter.adapt is not a function

core v6.0.3
do i need to create issue? i have standart webpack app with babel, rx and cycle-dom ;d

Adam Wendell
@AdamWendell
@frontendthug Please link your package.json
Andrey
@frontendthug
'''
{
"name": "cycle",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --hot --inline --content-base app"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@cycle/core": "^6.0.3",
"@cycle/dom": "^10.0.0-rc7",
"@cycle/rx-adapter": "^1.0.3",
"babel-core": "^6.7.7",
"rx": "^4.1.0"
},
"devDependencies": {
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.6.0",
"babel-preset-stage-0": "^6.5.0",
"html-webpack-plugin": "^2.16.0",
"webpack": "^1.13.0",
"webpack-dev-server": "^1.14.1"
}
}
'''
damn
André Staltz
@staltz
@laszlokorte yes laszlo, Cycle run converts sinks to the driver's stream lib, but I think sinks are always first-order, so no need for flattening :smile:
Laszlo Korte
@laszlokorte
Sorry, I meant nested sources, like the ones in the http driver
Steve Lee
@SteveALee
those xstream performance results are very interesting - well at least to me :) SO yes xstream in same ballpark as RxJS 5 - sometimes faster, sometimes slower. Most is impressive. Note sure about Array though.
Adam Wendell
@AdamWendell
@frontendthug With "@cycle/core": "^6.0.3" you don't need a adapter
André Staltz
@staltz
Yeah, the driver receives from run the stream lib used by the application, so the driver needs to adapt the stream before giving it as sources @laszlokorte
Adam Wendell
@AdamWendell
So you might need to use a older version of the @cycle/dom. But I'm not sure. Haven't played around enough with the latest to be sure.
Andrey
@frontendthug
@AdamWendell please check https://github.com/frontendthug/cyclejs-issue :(
Thomas Belin
@atomrc
Hey guys, I guess my question is going to be dead simple for you, but I don't understand why the proxy$ stream doesn't produce any value here :
javascript
function log(from) {
  return function () {
    console.log(from, arguments);
  };
}

const proxy$ = new Rx.Subject();
const value$ = Rx.Observable.just("test");

value$.subscribe(proxy$);
value$.subscribe(log("original"));
proxy$.subscribe(log("proxy"));
here is the corresponding jsbin : https://jsbin.com/vihuga/edit?html,js,console
is this a problem of hot/cold or completed stream?
Laszlo Korte
@laszlokorte
@atomrc yes, The proxy receives the "test" value before itself has any subscribers
You could either use a ReplaySubject or put the value$.subscribe(proxy$); call in the end
Thomas Belin
@atomrc
oh indeed putting it at the end is working, thk @laszlokorte
I find this pretty hard to understand at the beginning
Laszlo Korte
@laszlokorte
but is it clear now? Or should I elaborate?
Thomas Belin
@atomrc
No it's ok I got it thk :) The thing is I though this was my problem for the unit test I am writing but it not the same problem is seems :(
so I guess I'll have to dig a little deeper to find the source of my problem
fenduru
@fenduru
@staltz perfect timing with xstream - was literally just trying to convince my team to start incorporating FRP into our project, but they were looking for something lightweight to prove the concept
How do you create things like someStream$.withLatestFrom(otherStream$)? I can't seem to figure out how you would accomplish any sort of sampling with xstream
Adam Wendell
@AdamWendell
@frontendthug Was out with the dog :) The simplest thing that solves your problem is just to change to @cycle/dom": "^9.4.0".
Laszlo Korte
@laszlokorte
@fenduru someStream$.map((e1) => otherStream$.take(1).map(e2 => [e1, e2])).flatten() might work (@staltz mentioned something like this, I am not sure if I remember it correctly)
fenduru
@fenduru
@laszlokorte I think I would have to call .remember() on otherStream$ outside of the map, but yeah I think that's close
Andrey
@frontendthug
@AdamWendell it works, thanks!) but... is it bug or ... new api ? o_o
Steve Lee
@SteveALee
@laszlokorte now that's a useful tecnique I not thought of - closures within stream operators. Obvious now you show it :)
not as neat though
Adam Wendell
@AdamWendell
It's new api coming from the diversity branch. Which will give you the ability to chose a stream library instead of being forced to use Rx.
André Staltz
@staltz
@fenduru withLatestFrom is