hoist-react
hoist-react copied to clipboard
Warn developer via console if `doLoadAsync` called multiple times in quick succession
Unintentional doubled-up loads are an easy problem to create with competing reactions, debounces, and automatic load-on-mount for linked models, and they can be tricky to catch as if you're not looking at the network traffic everything in the app can appear to be a-OK, despite having doubled the load on the server.
Should we detect such a situation and throw a console warning, potentially only in development mode, to aid developers in catching such cases - without having to put any bigger stake in the ground as to what is / is not acceptable or must be a mistake?
If we had such a warning, would we need a way to suppress it, either globally or for a single model? (In case there was some very valid reason for it and the warning was deemed spurious / obnoxious.)