react-spa
react-spa copied to clipboard
stores code duplication
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 ?
@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!
Refactored the common functionality into a mixin. Let me know what you think.