terriajs icon indicating copy to clipboard operation
terriajs copied to clipboard

Update model layer docs with more strict rules around `mobx.action` and async/Promise functions

Open tephenavies opened this issue 4 years ago • 2 comments

Wrapping an async function with mobx.action can hide mobx reactivity bugs. mobx.action (and flow, runInAction, untracked, etc.) should be used conservatively in places where a user causes a state mutation, or when an async request (started by a user) finishes and state must be mutated.

tephenavies avatar Nov 28 '20 04:11 tephenavies

See #5026 and #5032 for an example of this type of problem.

tephenavies avatar Jan 22 '21 01:01 tephenavies

ticket is for updating docs for contributors

wibily avatar Jul 07 '21 03:07 wibily