From 6a61bad63bc72e7db5d355b622ee7ba795ba5ad8 Mon Sep 17 00:00:00 2001 From: apollo79 <90517340+apollo79@users.noreply.github.com> Date: Mon, 25 Mar 2024 08:28:28 +0100 Subject: [PATCH] feat: new O(1) context api --- src/objects/context.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/objects/context.ts diff --git a/src/objects/context.ts b/src/objects/context.ts new file mode 100644 index 0000000..d3f78e6 --- /dev/null +++ b/src/objects/context.ts @@ -0,0 +1,12 @@ +import { Owner } from "~/objects/owner.ts"; +import { Contexts } from "~/types.ts"; + +export class Context extends Owner { + contexts: Contexts; + + constructor(contexts: Contexts) { + super(); + + this.contexts = { ...this.parentScope?.contexts, ...contexts }; + } +}