Skip to content

Instantly share code, notes, and snippets.

@kyleshevlin
Created March 2, 2021 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyleshevlin/006e88c360b4b8fd56be02bdea8dc62a to your computer and use it in GitHub Desktop.
Save kyleshevlin/006e88c360b4b8fd56be02bdea8dc62a to your computer and use it in GitHub Desktop.
function getInitialValues({
thing,
slug,
}): {
return {
_id: thing?._id ?? "",
birb: thing?.workingThing?.birb
? JSON.parse(thing?.workingThing?.birb)
: undefined,
doge: thing?.workingThing?.doge ?? "",
cat: thing?.cat._id ?? slug ?? "",
lemur: thing?.workingThing?.lemur ?? "",
goose: thing?.goose ?? defaultGoose,
manatee: thing?.workingThing?.manatee ?? "",
zebra: thing?.zebra ?? defaultZebra,
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment