cferdinandi / reef

A lightweight library for creating reactive, state-based components and UI.
https://reefjs.com
MIT License
1.16k stars 77 forks source link

Using Map or Set as store #167

Closed mouse0270 closed 2 years ago

mouse0270 commented 2 years ago

Would it be possible to add the ability to use a Map or a Set as a store in a future version? It appears stores are limited to just Array or Object.

cferdinandi commented 2 years ago

While technically possible, it also adds quite a bit of complexity to the underlying code.

given that the goal of this project is to be simple and feature-lite, I’m not sure the benefits of supporting Set() and Map() are worth that added complexity.

mouse0270 commented 2 years ago

Yeah, that makes a lot of sense, using an object is all that bad, I just like to use Maps and Sets over objects when I can. However, I understand that it would add a lot of complexity to support them. So that makes complete sense.