🧪 ORM is currently used internally in extensions and has not yet been tested in an application. If it sounds just like what you're looking to do in your application, please let us know!
Since read operations like traversal of graph edges are asynchronous in m-ld, an ORM domain can be in an "updating" state, in which some edge may not be fully loaded (sometimes called a "fault"). This mode is entered using the updating method. It gives access to an OrmUpdating state, from which graph content can be loaded. An updating state is required to create new subject instances attached to the domain object (also since their properties may need loading).
Mutations of the graph by the app MUST NOT be done in an updating state (a
subject property that is not yet loaded could have an unexpected value of
empty; and the app mutation may be overridden by an
asynchronous load). An exception to this is setting the initial properties
of a new subject. Changes to a subject, or to the whole ORM domain, can be
committed to a writeable m-ld state.
Global scope for the domain
Obtain an update that captures every mutation made by the app to the domain since the domain was last updated. The update should be immediately written to the m-ld engine. This method also REVERTS the mutations made in the app code. This is because the updates will be very quickly re-applied, having been processed by the m-ld engine, in the next update cycle.
A scope allows a code module such as an extension to avoid seeing some other module's ORM classes when asking for a subject instance. This can be important if the module's subject scope intersects with another module's. Note that in such circumstances it's probably a good idea to use module-specific properties, to avoid interference.
Allows the caller to wait for any active updating state to go out of scope, so that the app is free to mutate ORM subjects without risk of faults. This method can be used to protect any code that is called asynchronously, such as an event handler in a user interface.
Call to obtain an updating state of the domain, to be used to create or load ORM subjects.
a readable m-ld core API state
a procedure that uses the updating state – the given updating state is guaranteed to remain valid until the returned promise settles.