Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support lazy widgets with a function that returns a promise in w() #69

Merged
merged 1 commit into from
Aug 17, 2018

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