feat: layered and scoped middleware and context state (#139)

Co-authored-by: Luca Casonato <hello@lcas.dev>
This commit is contained in:
Sylvain Cau
2022-04-23 22:07:40 +02:00
committed by GitHub
co-authored by Luca Casonato
parent b36f2c1a43
commit 8d4e77f4ac
19 changed files with 422 additions and 58 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ export function render(ctx: RenderContext, render: RenderFn) {
const snapshot = ctx.state.get("twindSnapshot") as unknown[] | null;
sheet.reset(snapshot || undefined);
render();
ctx.styles.splice(0, ctx.styles.length, ...sheet.target);
ctx.styles.splice(0, ctx.styles.length, ...(sheet).target);
const newSnapshot = sheet.reset();
ctx.state.set("twindSnapshot", newSnapshot);
}