JavaScriptRegenerated / yieldmachine

Components for State Machines, using Generator Functions
https://regenerated.dev/yieldmachine
MIT License
33 stars 0 forks source link

Make promised values available under key-values instead of array #5

Closed RoyalIcing closed 3 years ago

RoyalIcing commented 3 years ago
  function* loading() {
    yield entry(fetchData);
  }

Currently:

const machine = …
machine.next("FETCH");
machine.values.then(values => values[0]);

Future:

const machine = …
machine.next("FETCH");
machine.values.then(values => values.fetchData);