WRidder / react-spa

Community site SPA based on ReactJS
http://react-spa.herokuapp.com/
MIT License
297 stars 34 forks source link

stores code duplication #9

Open FredericHeem opened 9 years ago

FredericHeem commented 9 years ago

Would it be possible to reduce the code duplication regarding the store implementation ? The functions forThisStore, onLoadResourceSuccess and onLoadResourceFail are copied all over. Do you have any ideas on how to reduce the boiler plate to write new rest enabled stores ?

WRidder commented 9 years ago

@FredericHeem Good point. Actually, I'm looking into updating the codebase to React 0.13.x which gives us proper classes. That means we can create a proper base class for the stores containing common functionality. For the current setup, probably mixins may be an option as well. Will look into it!

WRidder commented 9 years ago

Refactored the common functionality into a mixin. Let me know what you think.