import retarget from 'retarget'const selector = retarget`dot.seperated.path.to.value`const state = {/* Huge object */}selector(state) // returns the value at "dot.seperated.path.to.value"
Returns
retarget returns a function that when passed an obj, attempts to get the value for the given path.