Skip to content

Instantly share code, notes, and snippets.

@dvtng
Last active June 10, 2020 01:24
Show Gist options
  • Save dvtng/0bbc0db907ceb12932e7ff1d1e95bbba to your computer and use it in GitHub Desktop.
Save dvtng/0bbc0db907ceb12932e7ff1d1e95bbba to your computer and use it in GitHub Desktop.
const { mutate, invalidate } = useRestable()
const orderRecord = await mutate(
OrderRecord.create({ /* payload */ })
)
await invalidate(
// Invalidate the list of all OrderRecords
{ model: OrderRecord, many: true },
// Invalidate the list of OrderRecords for this instrumentId
{ model: OrderRecord, many: true, params: { instrumentId } },
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment