mirror of
https://github.com/liabru/matter-js.git
synced 2025-03-14 00:38:41 -04:00
Updated Creating plugins (markdown)
parent
8a87a5c891
commit
6c13ca0b75
1 changed files with 2 additions and 2 deletions
|
@ -110,7 +110,7 @@ var MyPlugin = {
|
|||
// ...
|
||||
|
||||
install: function(base) {
|
||||
base.Engine.create = Matter.chain(
|
||||
base.Engine.create = Matter.Common.chain(
|
||||
base.Engine.create,
|
||||
function() {
|
||||
MyPlugin.Engine.init(this);
|
||||
|
@ -131,7 +131,7 @@ var MyPlugin = {
|
|||
|
||||
When this plugin is installed, it will log to the console `'MyPlugin.Engine.init: ...` whenever `Matter.Engine.create` is called.
|
||||
|
||||
Note that by using `Matter.chain` you can also:
|
||||
Note that by using `Common.chain` you can also:
|
||||
- chain before _or_ after the original method
|
||||
- chain as many functions as you need
|
||||
- override the returned value of the chain by using `return`
|
||||
|
|
Loading…
Add table
Reference in a new issue