Skip to content

Instantly share code, notes, and snippets.

@kyleshevlin
Created March 2, 2021 21:55
Show Gist options
  • Save kyleshevlin/006e88c360b4b8fd56be02bdea8dc62a to your computer and use it in GitHub Desktop.
Save kyleshevlin/006e88c360b4b8fd56be02bdea8dc62a to your computer and use it in GitHub Desktop.

Revisions

  1. kyleshevlin created this gist Mar 2, 2021.
    17 changes: 17 additions & 0 deletions iHaveSoManyQuestions.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    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,
    };
    }