dhmk083 / dhmk-zustand-lens

96 stars 5 forks source link

how much work would it take to extend this library to support lenses over arrays #9

Closed lukesmurray closed 2 years ago

lukesmurray commented 2 years ago

At the moment lenses only work for plain objects. I would love to extend this library to support arrays as well.

dhmk083 commented 2 years ago

Could you provide a use case?

Also, you should be able to achieve array support with createLens function, although, as noted in your your PR, it has a problem with types. I will fix that.

lukesmurray commented 2 years ago

See my comment here https://github.com/dhmk083/dhmk-zustand-lens/pull/10#issuecomment-1137143358.

In summary, I don't think there is a strong use case and I ended up taking an alternative approach.