Search
subscribeToActiveBranch
Beta
subscribeToActiveBranch
Subscribe to changes in the active project branch.
framer.subscribeToActiveBranch(callback: (branch: Branch) => void): Unsubscribe
The callback is called with the active branch immediately and whenever the editor switches to a different branch. It does not run when the active branch's metadata or content changes. The branch passed to the callback is a snapshot; call getBranch when you need its latest data.
Parameters
callback:(branch: Branch) => void
Returns
Unsubscribe– A function to call to unsubscribe.