MCPcopy Index your code
hub / github.com/microsoft/SandDance / loaderFactory

Function loaderFactory

docs/app/js/sanddance-app.js:108928–108937  ·  view source on GitHub ↗

* Factory for a loader constructor that provides methods for requesting * files from either the network or disk, and for sanitizing request URIs. * @param {function} fetch - The Fetch API for HTTP network requests. * If null or undefined, HTTP loading will be disabled. * @param {object} fs - T

(fetch, fs)

Source from the content-addressed store, hash-verified

108926 * param {object} [options] - Optional default loading options to use.
108927 * return {object} - A new loader instance.
108928 */ function loaderFactory(fetch, fs) {
108929 return (options)=>({
108930 options: options || {},
108931 sanitize: sanitize,
108932 load: load,
108933 fileAccess: !!fs,
108934 file: fileLoader(fs),
108935 http: httpLoader(fetch)
108936 });
108937}
108938/**
108939 * Load an external resource, typically either from the web or from the local
108940 * filesystem. This function uses {@link sanitize} to first sanitize the uri,

Callers 1

sanddance-app.jsFile · 0.70

Calls 2

fileLoaderFunction · 0.70
httpLoaderFunction · 0.70

Tested by

no test coverage detected