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 saveEntityRecord from redux-rungen to async thunks #33201

Merged
merged 14 commits into from
Aug 30, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adjust args to select()
  • Loading branch information
adamziel committed Aug 30, 2021
commit f0b22c0ef848a97a3ff2fb0c9183c56022413991
6 changes: 1 addition & 5 deletions packages/core-data/src/actions.js
Original file line number Diff line number Diff line change
@@ -403,7 +403,7 @@ export const saveEntityRecord = (
}
}

dispatch( {
await dispatch( {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This action is also purely synchronous.

type: 'SAVE_ENTITY_RECORD_START',
kind,
name,
@@ -417,8 +417,6 @@ export const saveEntityRecord = (
recordId ? '/' + recordId : ''
}`;
const persistedRecord = select.getRawEntityRecord(
STORE_NAME,
'getRawEntityRecord',
kind,
name,
recordId
@@ -432,8 +430,6 @@ export const saveEntityRecord = (
const currentUser = select.getCurrentUser();
const currentUserId = currentUser ? currentUser.id : undefined;
const autosavePost = select.getAutosave(
STORE_NAME,
'getAutosave',
persistedRecord.type,
persistedRecord.id,
currentUserId