pbomb / flow-immutable-models

Generates model classes from Flow types using Immutable.js
42 stars 8 forks source link

Change setters to have return type of `this` #14

Closed pbomb closed 7 years ago

pbomb commented 7 years ago

Instead of setters returning the class name, use this so that the class can be extended. To support this, switch setters from calling new ClassName to using this.clone.

I'm not sure about whether extending model classes will let users sleep well at night, but this change itself doesn't seem harmful.