File size: 474 Bytes
68465df
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Simple store for passing text editor values back
class TextEditorStore {
  private pendingValue: {key: string; value: string} | null = null

  setPendingValue(key: string, value: string) {
    this.pendingValue = {key, value}
  }

  getPendingValue(): {key: string; value: string} | null {
    const value = this.pendingValue
    this.pendingValue = null // Clear after reading
    return value
  }
}

export const textEditorStore = new TextEditorStore()