How to get InitialDocumentsManager


import InitialDocumentsManager from 'fontoxml-remote-documents/initialDocumentsManager'


], function (
) {

Type: Class

The InitialDocumentsManager provides an interface to load, unload and reload the documents to be shown in the editor. Various implementations of these functions exist that modify the DocumentsHierarchy in different ways. This manager uncouples other code from the specifics of those implementations.

It also provides a notifier to signal when the initial documents have loaded.


Name Type Description
initialDocumentsLoadedNotifier Notifier

Invoked after the initial documents have loaded


Name Description

Set the functions to use for loading, unloading and reloading the documents to be used in the editor.

# Name Type Description
1. loadInitialDocuments Function

called with an array of remote document IDs parsed from the scope should return a Promise which resolves when loading is completed

2. unloadDocuments Function

called when the user leaves the editor route to clean up all documents loaded during the initial load as well as any subsequent operations.

3. reloadDocument Function

called with a local document ID when a document needs to be reloaded, for instance when locking the document fails. Should return a Promise that resolves to the new document ID when loading completes.

4. [retryLoadingDocumentForHierarchyNode] Function

called with a DocumentsHierarchyNode to retry loading documents on demand if the initial load failed for any reason. Should return a Promise that resolves when loading completes.