Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the core-data store to thunks #28389

Merged
merged 10 commits into from
Sep 8, 2021
Prev Previous commit
Remove awaits from synchronous calls
  • Loading branch information
adamziel committed Sep 8, 2021

Verified

This commit was signed with the committer’s verified signature.
ciscorn Taku Fukada
commit 71b062a456c0e3c423ec24207b064626f6b3f8cd
10 changes: 5 additions & 5 deletions packages/core-data/src/actions.js
Original file line number Diff line number Diff line change
@@ -369,7 +369,7 @@ export const saveEntityRecord = (
const evaluatedValue = value(
select.getEditedEntityRecord( kind, name, recordId )
);
await dispatch.editEntityRecord(
dispatch.editEntityRecord(
kind,
name,
recordId,
@@ -474,15 +474,15 @@ export const saveEntityRecord = (
},
{}
);
await dispatch.receiveEntityRecords(
dispatch.receiveEntityRecords(
kind,
name,
newRecord,
undefined,
true
);
} else {
await dispatch.receiveAutosaves(
dispatch.receiveAutosaves(
persistedRecord.id,
updatedRecord
);
@@ -503,7 +503,7 @@ export const saveEntityRecord = (
method: recordId ? 'PUT' : 'POST',
data: edits,
} );
await dispatch.receiveEntityRecords(
dispatch.receiveEntityRecords(
kind,
name,
updatedRecord,
@@ -526,7 +526,7 @@ export const saveEntityRecord = (

return updatedRecord;
} finally {
await dispatch.__unstableReleaseStoreLock( lock );
dispatch.__unstableReleaseStoreLock( lock );
}
};