How to use the mobx-utils.lazyObservable function in mobx-utils

To help you get started, we’ve selected a few mobx-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TerriaJS / terriajs / lib / Models / WebMapServiceCatalogItem2.js View on Github external
this.getCapabilities = mobxUtils.createTransformer(terria => {
            const url = this.getCapabilitiesUrl;
            return mobxUtils.lazyObservable(sink => {
                loadXML(url).then(sink);
            }, undefined).current();
        });
github PacktPublishing / MobX-Quick-Start-Guide / src / Chapter08 / lazyObservable.js View on Github external
constructor() {
        this.operation = lazyObservable(async sink => {
            sink(null);
            const result = await this.performOperation();
            sink(result);
        });
    }