Skip to content

Commit

Permalink
feat(shape): Implements static method that creates new instances of s…
Browse files Browse the repository at this point in the history
…hapes
  • Loading branch information
ghaiklor committed Nov 12, 2015
1 parent f4c4376 commit 75b8c20
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,13 @@ export class Shape {
// TODO: Make sure that it's correct
throw new Error('render() method must be implemented');
}

/**
* Create new shape instance
* @param {*} args
* @returns {Shape}
*/
static create(...args) {
return new this(...args);
}
}

0 comments on commit 75b8c20

Please sign in to comment.