Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

sourceMapProvider called multiple times #5

@moshest

Description

@moshest

It should use a caching mechanism like this:

const cache: { [fileUrl: string]: Promise<SourceMap> } = {};

// fetch file every request
function fetchFile(fileUrl: string): Promise<SourceMap>;

// fetch file only once
function sourceMapProvider(fileUrl: string): Promise<SourceMap> {
  if (!(fileUrl in cache)) {
    // this will return promise that will fetched only once
    cache[fileUrl] = fetchFile(fileUrl); 
  }
  
  return cache[fileUrl];
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions