4 ms·
Won't using string paths like lodash makes it hard to use this library with typescript?
by cakerace 6y ago
Won't using string paths like lodash makes it hard to use this library with typescript?
- harrisonhope 6y agoProbably a fair point. I hadn't really taken typescript into account for the purposes of this library.
- mikewhy 6y agoSince in TS you can guarantee the user has optional chaining, so it may not be that big a change // instead of useHookedOnState('app.components.counterValue', 0) // maybe useHookedOnState(state => state.app?.components?.counterValue, 0) edit: on second thought, you're probably using that string in the setter as well. dang.
- harrisonhope 6y agoYup, that's the "magic" part.