@episerver/amd-loader-proxy
A proxy to the AMD require function used in Episerver
Last updated 2 years ago by ben_mckernan .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @episerver/amd-loader-proxy 
SYNC missed versions from official npm registry.

amd-loader-proxy

A proxy to the AMD require function used in Episerver.

Installation

yarn

yarn add @episerver/amd-loader-proxy

npm

npm install @episerver/amd-loader-proxy

Importing

import loader from "@episerver/amd-loader-proxy";

Usage

The @episerver/amd-loader-proxy package exports a single function that takes the module ids as string parameters and returns a promise. This promise will resolve to an array containing the results for each module, e.g.:

// Load a single AMD module.
loader("dojo/topic").then(([topic]) => {

});

// Load multiple AMD modules.
loader("dojo/topic", "epi-cms/plugin-area/navigation-tree").then(([topic, navigationTreePluginArea]) => {

});

Or if you are using async/await:

const foo = async () => {
    // Load a single AMD module.
    const [topic] = await loader("dojo/topic");

    // Load multiple AMD modules.
    const [topic, navigationTreePluginArea] = await loader("dojo/topic", "epi-cms/plugin-area/navigation-tree");
}

License

MIT © Episerver

Current Tags

  • 1.0.0                                ...           latest (2 years ago)

1 Versions

  • 1.0.0                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |