server record clearing

This commit is contained in:
Seth Trowbridge 2023-04-21 22:21:04 -04:00
parent 26cb46923f
commit 1ed3e0abaa
2 changed files with 3 additions and 2 deletions

View File

@ -164,7 +164,7 @@ export type FetchRecord = {URL:string, CacheFor:number, CachedAt:number, CacheOn
export const Fetch = { export const Fetch = {
Cache:new Map() as Map<string, FetchRecord>, Cache:new Map() as Map<string, FetchRecord>,
ServerBlocking:false as false|Promise<FetchRecord>[], ServerBlocking:false as false|Promise<FetchRecord>[],
ServerTouched:new Set() as Set<FetchRecord>, ServerTouched:false as false|Set<FetchRecord>,
Seed(seed:FetchRecord[]) Seed(seed:FetchRecord[])
{ {
seed.forEach(r=>{ seed.forEach(r=>{

View File

@ -222,6 +222,7 @@ FileListen("${url.pathname}", reloadHandler);`;
else else
{ {
Iso.Fetch.ServerBlocking = []; Iso.Fetch.ServerBlocking = [];
Iso.Fetch.ServerTouched = new Set();
let bake = SSR(<Iso.Router.Provider url={url}><App/></Iso.Router.Provider>); let bake = SSR(<Iso.Router.Provider url={url}><App/></Iso.Router.Provider>);
while(Iso.Fetch.ServerBlocking.length) while(Iso.Fetch.ServerBlocking.length)
{ {
@ -237,7 +238,7 @@ FileListen("${url.pathname}", reloadHandler);`;
delete r.Promise; delete r.Promise;
seed.push(r); seed.push(r);
}); });
Iso.Fetch.ServerTouched = new Set(); Iso.Fetch.ServerTouched = false;
const results = Twind.extract(bake, TwindInst); const results = Twind.extract(bake, TwindInst);