Skip to content

Commit a675f49

Browse files
committed
Docs: Add note about plugin opt-in for controls
1 parent 5d9b7ad commit a675f49

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/data/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ The `resolvers` option should be passed as an object where each key is the name
129129

130130
### `controls`
131131

132+
_**Note:** Controls are an opt-in feature, enabled via `use` (the [Plugins API](https://github.com/WordPress/gutenberg/tree/master/packages/data/src/plugins))._
133+
132134
A **control** defines the execution flow behavior associated with a specific action type. This can be particularly useful in implementing asynchronous data flows for your store. By defining your action creator or resolvers as a generator which yields specific controlled action types, the execution will proceed as defined by the control handler.
133135

134136
The `controls` option should be passed as an object where each key is the name of the action type to act upon, the value a function which receives the original action object. It should returns either a promise which is to resolve when evaluation of the action should continue, or a value. The value or resolved promise value is assigned on the return value of the yield assignment. If the control handler returns undefined, the execution is not continued.

0 commit comments

Comments
 (0)