Function useEditorContext

React hook returning the current editor context (dirty set), re-rendering when it changes. Handy for a contribute dialog: const { dirtyPaths } = useEditorContext() to show "you'll save N files" before calling contribute().