DEV: Update docs for composerBeforeSave (#18746)

* DEV: Update docs for composerBeforeSave
This commit is contained in:
Isaac Janzen 2022-10-25 14:19:45 -05:00 committed by GitHub
parent d0f88da9c9
commit 2737bc55bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -1223,11 +1223,14 @@ class PluginApi {
/**
* Registers a "beforeSave" function on the composer. This allows you to
* implement custom logic that will happen before the user makes a post.
* The passed function is expected to return a promise.
*
* Example:
*
* api.composerBeforeSave(() => {
* console.log("Before saving, do something!");
* return new Promise(() => {
* console.log("Before saving, do something!")
* })
* })
*/
composerBeforeSave(method) {