Last active
June 10, 2020 01:13
-
-
Save dvtng/5c57b510d577782d23c6196b9dfdf471 to your computer and use it in GitHub Desktop.
This file contains 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, | |
// to ensure the stock detail page is up-to-date | |
const refresh2 = dispatch(OrderRecord.issueQuery({ | |
queryParams: { instrumentId /* no static typing */ } | |
}, { fetchLimit: 0 })).meta.promise | |
// Await on both refreshes so we're not doing it in sequence | |
await Promise.all([refresh1, refresh2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment