Skip to content

Suggestion to make API simpler #10

@staltz

Description

@staltz

Instead of this:

let {DOM: timeTravelBar$, timeTravel} = makeTimeTravel(DOM, [
    {stream: count$, label: 'count$'},          
    {stream: action$, label: 'action$'}      
  ]);

How about this?

let {DOM: timeTravelBar$, timeTravel} = makeTimeTravel(DOM, {
  count$,
  action$
});

You can loop over the properties of an object and get its key. That above was sugar for ES5:

let {DOM: timeTravelBar$, timeTravel} = makeTimeTravel(DOM, {
  count$: count$,
  action$: action$
});

Meaning you will have both the key as a string and the value. Gladly ES6 makes it easy to avoid this repetition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions