This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dispatch = useDispatch() | |
await dispatch(OrderRecord.issueCreate( | |
{ /* no static typing */ } | |
)).meta.promise | |
// Refresh all OrderRecords, | |
// to ensure the account history page is up-to-date | |
const refresh1 = dispatch(OrderRecord.issueQuery({}, { | |
fetchLimit: 0 | |
})).meta.promise | |
// Also refresh OrderRecords filtered by this instrumentId, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } }, | |
) |
OlderNewer