issue/fetch #21

Merged
SethTrowbridge merged 9 commits from issue/fetch into master 2023-04-22 15:18:27 -04:00
2 changed files with 3 additions and 2 deletions
Showing only changes of commit 1ed3e0abaa - Show all commits

View File

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

View File

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