Search
subscribeToOpenCodeFile
subscribeToOpenCodeFile
Subscribe to changes in the Code Editor's active file.
const unsubscribe = framer.subscribeToOpenCodeFile((codeFile) => { if (codeFile) { console.log(`Currently open code file: ${codeFile.id}`) } }) // Later, stop listening unsubscribe()
This function is primarily useful when the plugin's mode is "code".
Parameters
callback:(codeFile: CodeFile | null) => void– Function called when the active code file changes.
Returns
Unsubscribe– A function to stop listening to changes.