Skip to content

Commit

Permalink
chore: create ScriptsPromises type
Browse files Browse the repository at this point in the history
  • Loading branch information
hosseinmd committed Oct 3, 2024
1 parent 8c7a586 commit e3b0e4a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/repack/src/modules/ScriptManager/ScriptManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ type Cache = Record<
Pick<NormalizedScriptLocator, 'method' | 'url' | 'query' | 'headers' | 'body'>
>;

type ScriptsPromises = Record<
string,
(Promise<void> & { isPrefetch?: true }) | undefined
>;

const CACHE_NAME = 'Repack.ScriptManager.Cache';
const CACHE_VERSION = 'v4';
const CACHE_ENV = __DEV__ ? 'debug' : 'release';
Expand Down Expand Up @@ -92,10 +97,7 @@ export class ScriptManager extends EventEmitter {
}

protected cache: Cache = {};
protected scriptsPromises: Record<
string,
(Promise<void> & { isPrefetch?: true }) | undefined
> = {};
protected scriptsPromises: ScriptsPromises = {};
protected cacheInitialized = false;
protected resolvers: [number, ScriptLocatorResolver][] = [];
protected storage?: StorageApi;
Expand Down

0 comments on commit e3b0e4a

Please sign in to comment.