diff options
Diffstat (limited to 'llparse-frontend/src/node/slot.ts')
-rw-r--r-- | llparse-frontend/src/node/slot.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llparse-frontend/src/node/slot.ts b/llparse-frontend/src/node/slot.ts new file mode 100644 index 0000000..923da86 --- /dev/null +++ b/llparse-frontend/src/node/slot.ts @@ -0,0 +1,20 @@ +import { IWrap } from '../wrap'; +import { Node } from './base'; + +export class Slot { + private privNode: IWrap<Node>; + + constructor(node: IWrap<Node>, + private readonly privUpdate: (value: IWrap<Node>) => void) { + this.privNode = node; + } + + public get node(): IWrap<Node> { + return this.privNode; + } + + public set node(value: IWrap<Node>) { + this.privNode = value; + this.privUpdate(value); + } +} |