Omnistac / zedux

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

feat(atoms): improve non-TS `.getInstance()` usage by throwing helpful errors #59

Closed bowheart closed 1 year ago

bowheart commented 1 year ago

Description

When using JS (non-TS), it's much easier to forget to pass something. It's ugly seeing Zedux throw errors from trying to use undefined values, etc. Throw helpful error messages instead in the most common case - when a non-template/instance is passed (directly or indirectly) to ecosystem.getInstance()