Omnistac / zedux

:zap: A Molecular State Engine for React
https://Omnistac.github.io/zedux/
MIT License
381 stars 7 forks source link

feat(atoms): allow setting promise to undefined in AtomApi #58

Closed bowheart closed 1 year ago

bowheart commented 1 year ago

Description

The .setPromise() method currently only accepts a promise. This can be a little annoying to work with e.g. when using inline expressions to conditionally set the promise. Allow such expressions to resolve to undefined and make the types correctly reflect that an atom with such a returned api has a Promise: undefined type.