MentraOS / mobile /src /utils /TextEditorStore.ts
Anirudh1950's picture
Add files using upload-large-folder tool
68465df verified
Raw History Blame Contribute Delete
474 Bytes
// 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()