@wordpress/hooks
Advanced tools
Comparing version 1.1.7 to 1.1.8
@@ -1,3 +0,7 @@ | ||
**1.1.6 (2018-03-21)** | ||
## 1.1.8 (2018-05-08) | ||
- Documentation: Improve usage examples ([#121](https://github.com/WordPress/packages/pull/121)) | ||
## 1.1.6 (2018-03-21) | ||
- Fix: Resolves issue where action argument would be undefined on all but the first action callback. |
{ | ||
"name": "@wordpress/hooks", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"description": "WordPress Hooks library", | ||
@@ -5,0 +5,0 @@ "author": "WordPress", |
# @wordpress/hooks | ||
A lightweight & efficient EventManager for JavaScript in WordPress. | ||
A lightweight & efficient EventManager for JavaScript. | ||
@@ -14,6 +14,11 @@ ## Installation | ||
### Usage | ||
In your JavaScript project, use hooks as follows: | ||
```javascript | ||
import { createHooks } from '@wordpress/hooks'; | ||
API functions can be called via the global `wp.hooks` like this `wp.hooks.addAction()`, etc. | ||
myObject.hooks = createHooks(); | ||
myObject.hooks.addAction(); //etc... | ||
``` | ||
A lightweight & efficient filter and action manager. | ||
In the WordPress context, API functions can be called via the global `wp.hooks` like this `wp.hooks.addAction()`, etc. | ||
@@ -40,9 +45,3 @@ ### API Usage | ||
Hooks can be added to an object via composition: | ||
`import { createHooks } from '@wordpress/hooks';` | ||
`myObject.hooks = createHooks();` | ||
API functions are then be called: `myObject.hooks.addAction()`. | ||
### Events on action/filter add or remove | ||
@@ -49,0 +48,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69929
53