Widdershin / rx-undoable

Easily add undo and redo to your RxJS or Cycle.js apps
MIT License
22 stars 0 forks source link

What does ideal API/usage look like? #3

Open Widdershin opened 8 years ago

Widdershin commented 8 years ago

What does an ideal API for this look like?

I like having the Rx.Observable.undoableScan operator, but I had issues getting it to actually load with browserify and es6 modules. I should ask the Rx team about that.

If anyone has any ideas or feedback, let me hear it.

Frikki commented 8 years ago

What issues did you face with browserify and ES 2015 modules? I mean, what setup? Which errors?

Widdershin commented 8 years ago

@Frikki the issue I ran into was with attempting to extend the prototype of Rx.Observable inside of the package itself.

The error I ran into was when I tried to install and import the module. It worked when directly importing the src/undoable.js file in my example, but when I attempted to import 'rx-undoable' my example code errored with Rx.Observable.undoableScan is not defined.

I can provide you with a reproducer if you like.

It's likely that I just misconfigured something in my package.json or browserify flags.

Frikki commented 8 years ago

Yes, do that. Then I could try to take a look at it.