diff --git a/@plotly/dash-component-plugins/package.json b/@plotly/dash-component-plugins/package.json index 0d51938be5..eaf967ced9 100644 --- a/@plotly/dash-component-plugins/package.json +++ b/@plotly/dash-component-plugins/package.json @@ -1,6 +1,6 @@ { "name": "@plotly/dash-component-plugins", - "version": "1.1.0", + "version": "1.2.0", "description": "Plugins for Dash Components", "repository": { "type": "git", diff --git a/@plotly/dash-component-plugins/src/dynamicImport.js b/@plotly/dash-component-plugins/src/dynamicImport.js index 29530bc9cf..c4ed18b121 100644 --- a/@plotly/dash-component-plugins/src/dynamicImport.js +++ b/@plotly/dash-component-plugins/src/dynamicImport.js @@ -27,5 +27,11 @@ export const asyncDecorator = (target, promise) => { return state.get; }; +export const inheritAsyncDecorator = (target, source) => { + Object.defineProperty(target, '_dashprivate_isLazyComponentReady', { + get: () => isReady(source) + }); +} + export const isReady = target => target && target._dashprivate_isLazyComponentReady; diff --git a/@plotly/dash-component-plugins/src/index.js b/@plotly/dash-component-plugins/src/index.js index 4cff6b60a1..3448f9e7b8 100644 --- a/@plotly/dash-component-plugins/src/index.js +++ b/@plotly/dash-component-plugins/src/index.js @@ -1,5 +1,5 @@ -import { asyncDecorator, isReady } from './dynamicImport'; +import { asyncDecorator, inheritAsyncDecorator, isReady } from './dynamicImport'; import History from './History'; -export { asyncDecorator, isReady }; +export { asyncDecorator, inheritAsyncDecorator, isReady }; export { History }; \ No newline at end of file