DEV Community

Discussion on: Simple Immutable Data w/ Spectacles 👓

Collapse
 
patroza profile image
Patrick Roza • Edited

Why not use a path string and support unlimited depth?
get("a.b")

Collapse
 
anthonyjoeseph profile image
Anthony G • Edited

The depth limit is due to tsc memory issues, and afaict there's no memory savings using a template literal vs a tuple. Though I am curious how template string autocomplete would look (if it could exist at all) - might be worth an experiment

Collapse
 
anthonyjoeseph profile image
Anthony G

Thanks for taking a look at the library!

Collapse
 
anthonyjoeseph profile image
Anthony G

Just wanted to let you know - I ended up taking your suggestion! It didn't end up helping w/ the depth issue (I used tail-recursive types for that), but it did improve autocomplete & inference (tuples had this issue)

Thanks for the help!