Skip to content

Commit

Permalink
fix(example): create vector inside calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTelanie committed Feb 17, 2019
1 parent dc9d28b commit d3e3b7d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,8 @@ try {
console.log('error:', error.toString());
// error: Error: set x() not implemented
}

// creating vector inside calculation works, but has overhead
const inlineVec = new Victor(() => new Victor(25, 30) / 2);
console.log(debug`inlineVec: ${inlineVec}`);
// inlineVec: { x: 12.5, y: 15, z: 0 }

0 comments on commit d3e3b7d

Please sign in to comment.