summaryrefslogtreecommitdiffstats
path: root/llparse-frontend/src/node/slot.ts
blob: 923da86135a57f61583de47755de4f0a70605c03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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);
  }
}