Linking any two objects in the session state

New feature in the session state editor
Added by Andy Dufilie over 1 year ago

A new feature in Weave allows you to link any two objects in the session state without using JavaScript. Changes to the first object will be reflected in the second object, and vice versa. Advanced users can also write scripts that can link two objects which are not initially compatible.

To link any two objects:
  • Open the session state editor and find the first object in the tree.
  • Right-click on the tree item and select "Copy path to selected object."
  • Find the second object in the tree, which should be the same type as the first object.
  • Right-click on the second tree item and select "Link session state with another object."
  • Paste in the path you copied for the first object and click "Ok."
  • Optional: The steps above create a new LinkableSynchronizer object at the top level of the session state which takes care of the linking. Advanced users can edit the session state of the synchronizer and enter primaryTransform and secondaryTransform scripts to generate new session state structures. The following variables are available in such scripts: state (the session state), primary (the primary object), secondary (the secondary object). The primary object is the one that you clicked on when selecting "Link session state with another object."