mobxjs / mobx-state-tree

Full-featured reactive state management without the boilerplate

Home Page:https://mobx-state-tree.js.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Document how MST lazily creates objects

scytacki opened this issue · comments

I think it would be useful to document how MST lazily creates its objects. It is that delay that caused #1951, and that delay is why it is possible with #1952 for the hooks to be called in different orders depending on how the objects are being referenced.

It is kind of a implementation detail (but a big one), so maybe you don't want it in the user facing documentation.

If I can find time I'll try make a PR adding documentation for this, but @coolsoftwaretyler and @jamonholmgren do you have opinions about where this documentation should go? It could be in hooks.md but it is kind of more general than that. It could be a new doc in "concepts". Or maybe you'd like to keep it just for developers; in that case I'm not sure where it should go.

Hey @scytacki - thanks for this! I personally would love to have it in the user-facing docs.

I think it might fit OK in Advanced Concepts, but I also think there isn't a great place for it as things stand.

One of the things we'll be doing to revitalize things around here is a docs overhaul. So if you were to write this up and drop it wherever, I think we can use that as an input for how we structure new docs.

There is no firm plan on where, when, how, etc. of the new docs, but I expect we'll get to it within the calendar year, or just into 2024.

I'm going to add some labels and assign this issue to you for the sake of keeping things tidy in the issue tracker. If you ever decide you don't want to do this, remove yourself and we can find another contributor to do so.