Skip to content

Commit

Permalink
Dispatch addEntities and receiveEntityRecords actions directly to cor…
Browse files Browse the repository at this point in the history
…e instead of proxying via core/editor
  • Loading branch information
Tug committed Sep 20, 2019
1 parent 284ea5e commit e95c9f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
6 changes: 4 additions & 2 deletions packages/editor/src/components/provider/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,19 @@ export default compose( [
} ),
withDispatch( ( dispatch ) => {
const {
addEntities,
editPost,
resetEditorBlocks,
receiveEntityRecords,
} = dispatch( 'core/editor' );
const {
clearSelectedBlock,
} = dispatch( 'core/block-editor' );
const {
switchEditorMode,
} = dispatch( 'core/edit-post' );
const {
addEntities,
receiveEntityRecords,
} = dispatch( 'core' );

return {
addEntities,
Expand Down
13 changes: 0 additions & 13 deletions packages/editor/src/store/actions.native.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@

/**
* WordPress dependencies
*/
import { dispatch } from '@wordpress/data-controls';

export * from './actions.js';

export function* receiveEntityRecords( kind, name, records, query, invalidateCache = false ) {
yield dispatch( 'core', 'receiveEntityRecords', kind, name, records, query, invalidateCache );
}

export function* addEntities( entities ) {
yield dispatch( 'core', 'addEntities', entities );
}

/**
* Returns an action object that enables or disables post title selection.
*
Expand Down

0 comments on commit e95c9f2

Please sign in to comment.