-
Notifications
You must be signed in to change notification settings - Fork 10
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
Suggestion to make API simpler #10
Comments
This is actually the interface I started with, the only problem is that we need some way of specifying the order that streams are displayed in. When using this object style, the order will change across runs, which isn't the best UX. There is also the consideration of wanting to pass along more options with the stream. This is actually already an undocumented feature.
I am open to something like this, but it would mean that trouble would happen if a user happened to supply a stream with the same name as an optional argument.
To mitigate that problem I could always use an options object.
Thoughts? |
Ok, good to know. let {DOM: timeTravelBar$, timeTravel} = makeTimeTravel(DOM, [
{count$, feature: true},
{action$}
]); I don't think this would be a problem. You can whitelist those options that you expect, and either throw an error when a user tries to give a property that collides with an option name, or always assume streams to be given with a $ suffix. |
Instead of this:
How about this?
You can loop over the properties of an object and get its key. That above was sugar for ES5:
Meaning you will have both the key as a string and the value. Gladly ES6 makes it easy to avoid this repetition.
The text was updated successfully, but these errors were encountered: