ExternalDataManager

Type: Class

How to get externalDataManager?

JavaScript

import externalDataManager from 'fontoxml-templated-views/src/externalDataManager.js'

Deprecated!

Use the addExternalValue API to manage external data

Some templates need to render something not in the current document, or something that is derived from other data, which is expensive to compute. To be able to react to changes in this data, external data can be used in a template.

External data can only be retrieved while rendering, by using NodeProxy#getExternalValue. It should never be set during rendering or during XPath evaluation. Make sure to always call setExternalData asynchronously (e.g., from a Promise.then or setTimeout callback) to avoid errors.

Please refer to the guide on fonto-documentation/docs/editor/fontoxml-editor-documentation/how-to-guides/custom-xpath---xquery-invalidation.xml for more information on how to expose external data to XPath using addExternalValue.

Methods

setExternalData

Type: Function

Deprecated!

Use the addExternalValue API to manage external data

Set a piece of external data and cause a rerender for any templated views depending on that data.

Note that internal mutations in the given value will not trigger view updates. It is therefore recommended to keep external values immutable and/or as flat as possible.

External data should never be set during rendering or during XPath evaluation. Always call this method asynchronously (e.g., from a Promise.then or setTimeout callback) to avoid errors.

Arguments