idx withDefault variant
cameron-chang opened this issue · 1 comments
cameron-chang commented
I think it would be nice to add an additional export of the idx function which will allow us to pass in a default value.
Since idx has its own type, it would be quite difficult to create a wrapper around idx without breaking the current type signature.
I propose an API that looks like this:
idxOr('DEFAULT VALUE', data, data => data.path.name);
Similar to ramda's pathOr
function http://ramdajs.com/docs/#pathOr