Skip to content

Conversation

agubler
Copy link
Member

@agubler agubler commented Aug 16, 2018

Type: feature

The following has been addressed in the PR:

Description:

Supports lazy widgets directly in w() using a function that returns a Promise that resolves to a widget constructor.

class MyWidget extends WidgetBase {
    private _loadWidget = () => {
        return import('./lazy');
    }

    render() {
        return w(this._loadWidget, {});
    }
}

Note: The function cannot change across renders as it cannot be tracked.

Resolves #57

@agubler agubler requested a review from matt-gadd August 16, 2018 20:18
@agubler agubler added enhancement New feature or request next Issue/Pull Request for the next major version labels Aug 16, 2018
@agubler agubler merged commit 07bdc06 into dojo:master Aug 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request next Issue/Pull Request for the next major version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support a function that returns a lazily imported widget when creating WNodes
2 participants