Last active
June 20, 2020 06:47
-
-
Save StefH/fc3ebc9da1a9f207291def517247e77e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class WebAssemblyResourceLoader { | |
// ... | |
loadResources(resources: ResourceList, url: (name: string) => string, resourceType: WebAssemblyBootResourceType): LoadingResource[] { | |
return Object.keys(resources) | |
.map(name => this.loadResource(name, url(name), resources[name], resourceType)); | |
} | |
loadResource(name: string, url: string, contentHash: string, resourceType: WebAssemblyBootResourceType): LoadingResource { | |
const response = this.cacheIfUsed | |
? this.loadResourceWithCaching(this.cacheIfUsed, name, url, contentHash, resourceType) | |
: this.loadResourceWithoutCaching(name, url, contentHash, resourceType); | |
return { name, url, response }; | |
} | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment