Skip to content

Commit

Permalink
Rely on redux-multi to dispatch multiple actions
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Feb 23, 2018
1 parent be44df7 commit 9a6c55b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions editor/components/post-text-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,15 @@ export default connect(
( state ) => ( {
value: getEditedPostContent( state ),
} ),
( dispatch ) => ( {
{
onChange( content ) {
dispatch( editPost( { content } ) );
return editPost( { content } );
},
onPersist( content ) {
dispatch( resetBlocks( parse( content ) ) );
dispatch( checkTemplateValidity() );
return [
resetBlocks( parse( content ) ),
checkTemplateValidity(),
];
},
} )
}
)( PostTextEditor );

0 comments on commit 9a6c55b

Please sign in to comment.