subscribeToBranches

Beta

subscribeToBranches

Subscribe to changes in the project's branches.

framer.subscribeToBranches(callback: (branches: readonly Branch[]) => void): Unsubscribe

The callback is called with the current branch list immediately, then when branches are created, deleted, renamed, rebased, joined, or left. It does not run for content changes. The branches passed to the callback are snapshots; call getBranch when you need the latest data for a specific branch.

Parameters

  • callback: (branches: readonly Branch[]) => void

Returns

  • Unsubscribe – A function to call to unsubscribe.