mistadikay / doob

:deciduous_tree: Smart immutable state for React
MIT License
64 stars 1 forks source link

Reasons for manual reloadComponentData #1

Closed Yomguithereal closed 9 years ago

Yomguithereal commented 9 years ago

Hello @mistadikay. One thing I do not understand about the DataWatcher decorator is the obligation to manually trigger reloadComponentData. Why not trigger it automatically as in your example in the componentWillReceiveProps hook?

mistadikay commented 9 years ago

Hi @Yomguithereal. Thanks for the feedback!

Yeah, actually we were thinking about that but hesitated because not every data dependency contains props and reloading data every time would be a slight overhead. But the more we work with this manual reloadComponentData, the more we think that maybe reloading it automatically wouldn't be that bad. So yes, I think we'll automate it in one of the nearest releases.

mistadikay commented 9 years ago

fixed in https://github.com/mistadikay/doob/commit/0c218b174c42c06ba438ef31c4431cc0cb82fadf