subscribeToCodeFiles

subscribeToCodeFiles

Subscribe to changes in code files across the project.

const unsubscribe = framer.subscribeToCodeFiles((codeFiles) => {
  console.log(`Code files updated: ${codeFiles.length} total files`)
})

// Later, stop listening
unsubscribe()

The callback is called when code files are added, removed, or updated, and receives an array of all code files in the project.

Parameters

  • callback: (codeFiles: readonly CodeFile[]) => void – Function called when code files change.

Returns

  • Unsubscribe – A function to stop listening to changes.