Best Practices for Developers

For more information on the best practices for renderer plugin creation, see this section.

Prevent Memory Leaks

Since the Data Inspector performs operations with megabytes of data in a browser while decoding and rendering, it is important to make sure that the garbage collector can clean memory properly.

This is especially important when you create a single-page application where simple removal of DOM elements is not enough. You should also make sure that event listeners are removed correctly.

For this purpose, DataInspector provides the destroy() method that unmounts its components properly, removes event listeners, and terminates web workers to prevent memory leaks.

Thus, in case you do not need a Data Inspector instance anymore, it is recommended to call the destroy() method prior to removing the DOM element:

dataInspector.destroy().then(() => {
dataInspector = null;

results matching ""

    No results matching ""