Skip to content

Commit

Permalink
Refactor to remove usage of post related effects in packages/editor. (#…
Browse files Browse the repository at this point in the history
…13716)

This pull is the first step in moving away from the lingering usage of effects in various data stores among packages. This pull specifically deals with post related effects in the @wordpress/editor package (`core/editor` store).
  • Loading branch information
nerrad authored and youknowriad committed Mar 6, 2019
1 parent 72ddc4c commit 2e488f6
Show file tree
Hide file tree
Showing 14 changed files with 1,588 additions and 648 deletions.
76 changes: 67 additions & 9 deletions docs/designers-developers/developers/data/data-core-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,43 @@ post has been received, by initialization or autosave.

* post: Autosave post object.

### __experimentalRequestPostUpdateStart

Optimistic action for dispatching that a post update request has started.

*Parameters*

* options: null

### __experimentalRequestPostUpdateSuccess

Optimistic action for indicating that the request post update has completed
successfully.

*Parameters*

* data: The data for the action.
* data.previousPost: The previous post prior to update.
* data.post: The new post after update
* data.isRevision: Whether the post is a revision or not.
* data.options: Options passed through from the original
action dispatch.
* data.postType: The post type object.

### __experimentalRequestPostUpdateFailure

Optimistic action for indicating that the request post update has completed
with a failure.

*Parameters*

* data: The data for the action
* data.post: The post that failed updating.
* data.edits: The fields that were being updated.
* data.error: The error from the failed call.
* data.options: Options passed through from the original
action dispatch.

### updatePost

Returns an action object used in signalling that a patch of updates for the
Expand All @@ -760,7 +797,8 @@ latest version of the post have been received.

### setupEditorState

Returns an action object used to setup the editor state when first opening an editor.
Returns an action object used to setup the editor state when first opening
an editor.

*Parameters*

Expand All @@ -775,18 +813,34 @@ been edited.

* edits: Post attributes to edit.

### __experimentalOptimisticUpdatePost

Returns action object produced by the updatePost creator augmented by
an optimist option that signals optimistically applying updates.

*Parameters*

* edits: Updated post fields.

### savePost

Returns an action object to save the post.
Action generator for saving the current post in the editor.

*Parameters*

* options: Options for the save.
* options.isAutosave: Perform an autosave if true.
* options: null

### refreshPost

Action generator for handling refreshing the current post.

### trashPost

Action generator for trashing the current post in the editor.

### autosave

Returns an action object used in signalling that the post should autosave.
Action generator used in signalling that the post should autosave.

*Parameters*

Expand Down Expand Up @@ -864,27 +918,31 @@ to be updated.

### __experimentalConvertBlockToStatic

Returns an action object used to convert a reusable block into a static block.
Returns an action object used to convert a reusable block into a static
block.

*Parameters*

* clientId: The client ID of the block to attach.

### __experimentalConvertBlockToReusable

Returns an action object used to convert a static block into a reusable block.
Returns an action object used to convert a static block into a reusable
block.

*Parameters*

* clientIds: The client IDs of the block to detach.

### enablePublishSidebar

Returns an action object used in signalling that the user has enabled the publish sidebar.
Returns an action object used in signalling that the user has enabled the
publish sidebar.

### disablePublishSidebar

Returns an action object used in signalling that the user has disabled the publish sidebar.
Returns an action object used in signalling that the user has disabled the
publish sidebar.

### lockPostSaving

Expand Down
1 change: 1 addition & 0 deletions packages/editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Removed `jQuery` dependency.
- Removed `TinyMCE` dependency.
- RichText: improve format boundaries.
- Refactor all post effects to action-generators using controls ([#13716](https://github.com/WordPress/gutenberg/pull/13716))

## 9.0.7 (2019-01-03)

Expand Down
Loading

0 comments on commit 2e488f6

Please sign in to comment.