You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 8, 2021. It is now read-only.
This would be similar to the existing export, except with the params flipped, curryable, and defaults split into another export:
import{composableGetasget,composableGetOrasgetOr}from'ts-get';// these are the same statementget(obj=>obj.a.b.c,inputObject);get(obj=>obj.a.b.c)(inputObject);// these are the same statementgetOr(defaultValue,obj=>obj.a.b.c,inputObject);getOr(defaultValue,obj=>obj.a.b.c)(inputObject);getOr(defaultValue)(obj=>obj.a.b.c,inputObject);getOr(defaultValue)(obj=>obj.a.b.c)(inputObject);
This would allow use with Ramda for things like the following (real simple example):
import{pipe,equals}from'ramda';import{composableGetasget}from'ts-get';import{getMetadataForIndex}from'./whatever-utils';exportfunctionsatisfiesCriteria(index: number,type: string): boolean{returnpipe(getMetadataForIndex,// this is passed indexget(metadata=>metadata.a.b.c),// this is passed the output of getMetadataForIndexequals(type)// this is passed the output of get)(index);};
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This would be similar to the existing export, except with the params flipped, curryable, and defaults split into another export:
This would allow use with Ramda for things like the following (real simple example):
The text was updated successfully, but these errors were encountered: