MCPcopy Create free account
hub / github.com/remix-run/react-router / set

Function set

tutorials/address-book/app/data.ts:49–55  ·  view source on GitHub ↗
(id: string, values: ContactMutation)

Source from the content-addressed store, hash-verified

47 },
48
49 async set(id: string, values: ContactMutation): Promise<ContactRecord> {
50 const contact = await fakeContacts.get(id);
51 invariant(contact, `No contact found for ${id}`);
52 const updatedContact = { ...contact, ...values };
53 fakeContacts.records[id] = updatedContact;
54 return updatedContact;
55 },
56
57 destroy(id: string): null {
58 delete fakeContacts.records[id];

Callers

nothing calls this directly

Calls 2

getMethod · 0.65
invariantFunction · 0.50

Tested by

no test coverage detected