21. Templates
● list of block items
● initial state for an editor session
● attributes and placeholder content
● per custom post type
● PHP and JS API
● Many planned additions
Handbook
Video Tutorial
26. Data store
● modular pattern for organizing and
sharing data
● Redux like core principles
● Browser plugins
● Handbook
● Beyond the block - David Remer
(inpsyde.com) (+Video + Code)
● Redux with WordPress - Josh Pollock
● Efficient client data management for
WordPress Plugins - Riad Benguella
27. Data store
● core/data, core/nux, core/viewport,
core/editor, core/edit-post, yoast-
seo/editor, …
● registerStore('my-shop', {...})
● store.select(): Returns the state value
of the registered reducer
● store.subscribe( listener: Function ):
Registers a function called any time
the value of state changes.
● store.dispatch( action: Object ): Given
an action object, calls the registered
reducer and updates the state value.
28. Data store
● get current post content
● get currently selected tags/categories
● is Sidebar visible
● notify if an image block is inserted
● Rest API data (latest post, user
object, create category)
● Store / upsate own plugin data
● get Data from other plugins
● extend other plugins