react-spa icon indicating copy to clipboard operation
react-spa copied to clipboard

stores code duplication

Open FredericHeem opened this issue 9 years ago • 2 comments

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 avatar Apr 10 '15 19:04 FredericHeem

@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 avatar Apr 10 '15 23:04 WRidder

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

WRidder avatar Apr 13 '15 10:04 WRidder