Skip to content

Commit

Permalink
change example matter-wrap require precedence
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Jan 29, 2021
1 parent 7bfd3c2 commit aa1e4e7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions examples/avalanche.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
var Example = Example || {};

Example.avalanche = function() {
if (typeof require !== 'undefined') {
// either require the plugin directly (Node.js, Webpack etc.)
Matter.use(require('matter-wrap'));
} else {
// or by name from plugin registry (Browser global)
if (typeof MatterWrap !== 'undefined') {
// either use by name from plugin registry (Browser global)
Matter.use('matter-wrap');
} else {
// or require and use the plugin directly (Node.js, Webpack etc.)
Matter.use(require('matter-wrap'));
}

var Engine = Matter.Engine,
Expand Down
10 changes: 5 additions & 5 deletions examples/ballPool.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
var Example = Example || {};

Example.ballPool = function() {
if (typeof require !== 'undefined') {
// either require the plugin directly (Node.js, Webpack etc.)
Matter.use(require('matter-wrap'));
} else {
// or by name from plugin registry (Browser global)
if (typeof MatterWrap !== 'undefined') {
// either use by name from plugin registry (Browser global)
Matter.use('matter-wrap');
} else {
// or require and use the plugin directly (Node.js, Webpack etc.)
Matter.use(require('matter-wrap'));
}

var Engine = Matter.Engine,
Expand Down

0 comments on commit aa1e4e7

Please sign in to comment.