Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept ES7 Observables instead of Kefir #17

Open
fiatjaf opened this issue Jun 14, 2017 · 3 comments
Open

Accept ES7 Observables instead of Kefir #17

fiatjaf opened this issue Jun 14, 2017 · 3 comments

Comments

@fiatjaf
Copy link

fiatjaf commented Jun 14, 2017

I know this library is specially modelled for Kefir streams, hence its name, but I think it would be great if any reactive streams library could be used (I personally like https://github.com/staltz/xstream, although Kefir looks great for my use-case), maybe using a different name and a different repository.

I've come up with the following changes: master...fiatjaf:b460d77fa8b38188e8003dc3de90bf161dc89d67

But they don't pass the tests (I've used xstream on the tests instead of Kefir), so I'm looking for help.

@fiatjaf
Copy link
Author

fiatjaf commented Jun 15, 2017

I think I got it right here: https://github.com/fiatjaf/oaret

@polytypic
Copy link
Member

polytypic commented Jun 15, 2017

I took a very quick look and it seems roughly right. 👍 There might be some corner cases to consider due to Kefir (and Bacon) having different semantics from those of ES7 observables in case of errors.

IIRC, @rikutiira was also interested in an ES7 observable port.

I noticed that you didn't port fromKaret? That is actually very nice to have every now and then. So I'd recommend porting it, too.

Also, you switched to using legacy CommonJS modules. Note that having the ES2015 style modules and a module entry point in package.json helps modern bundlers and UglifyJS to do a better job at dead code elimination. In fact, with Rollup, ES2015 modules, UglifyJS /*#__PURE__*/ annotations and FP style code, dead code elimination can be very effective.

BTW, did you notice the Gitter room?

@fiatjaf
Copy link
Author

fiatjaf commented Jun 15, 2017

I tried to keep the whole boilerplate, but I gave up when nyc (I guess it was this thing) started crashing my computer and leaving hanging processes whenever I ran the tests.

I also don't like the idea of having to compile the code before running the tests. I know you're right about ES modules and Rollup, since I recently read on that topic and got convinced, but I did what I did on a burst of irrational rage against nyc and babel.

In the long run I think I will bring back some things I've just deleted, yes, but now I just want to build the project I left hanging for a month while I searched for a library like karet (which I didn't know if existed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants