Skip to content

Conversation

@Shelob9
Copy link
Contributor

@Shelob9 Shelob9 commented Feb 13, 2018

For: #5032
Related: #5003

Description

This updates the docs for wp.data.subscribe for changes in #5003

How Has This Been Tested?

  • Pulled master, and ran the build script.
  • Put code in a block.
  • Saw it logged correctly.
  • [x ] My code is tested.
  • [x ] My code follows the WordPress code style.
  • [x ] My code has proper inline documentation.

//Post content
content :wp.data.select( 'core/editor', 'getEditedPostAttribute', 'content' ),
//Number of blocks currently selected
selectedBlockCount: wp.data.select( 'core/editor', 'getSelectedBlockCount' ),
Copy link
Contributor

Choose a reason for hiding this comment

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

The Documentation of the data module is meant to be generic. Should we document these selectors as part of the editor module's documentation instead?

Also, in Calypso we have a script to generate selectors documentation automatically, we might be able to adapt it here cc @aduth

@aduth
Copy link
Member

aduth commented Feb 13, 2018

The API for select has been revised as of #5007.

Also, you may be encountering errors because tests were briefly failing on master which was resolved in 6619a9f. You can remedy this by rebasing and pushing your branch:

# Assuming "upstream" is WordPress/Gutenberg
git checkout patch-2
git rebase upstream/master
git push -f origin patch-2

@aduth
Copy link
Member

aduth commented Feb 27, 2018

Any chance you'd be able to update this for the changes introduced by #5007?

Per Riad's feedback, I feel as though this should be limited to updating from:

getEditedPostSlug

To:

getEditedPostAttribute( 'slug' )

@aduth aduth added [Type] Developer Documentation Documentation for developers [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. labels Feb 27, 2018
@danielbachhuber
Copy link
Member

Closing re #5032 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Type] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants