ProjectChangeHandlerMixin
Properties
2
Properties
2Identifies an object as an instance of ProjectChangeHandlerMixin class, or subclass thereof.
Identifies an object as an instance of ProjectChangeHandlerMixin class, or subclass thereof.
Functions
1
Functions
1Allows to apply changes from one project to another. For method to produce correct results, projects should be isomorphic - they should use same models and store configuration, also data in source and target projects should be identical before changes to the source project are made and applied to the target project. This method is meant to apply changes in real time - as source project is changed, changes should be applied to the target project before it is changed. When changes are applied all changes are committed and project is recalculated, which means target project won't have any local changes after.
Usage:
// Collect changes from first project
const { changes } = projectA;
// Apply changes to second project
await projectB.applyProjectChanges(changes);
This method will override local fields with values from the changes object and commit changed fields. It will
keep changes in the project, if they are not present in the changes object.
When autoSync is enabled, and client wants to
apply changes without triggering a sync request, this method should be used instead of
applyChangeset. It helps maintain current
behavior while providing flexibility for scenarios where syncing is not required.
| Parameter | Type | Description |
|---|---|---|
changes | Object | Project changes object |
Returns: Promise