LocalDataStore.getOrCreate method
LocalDataStore › getOrCreate
Initializes a record once, atomically across connections.Signature:
getOrCreate(key: string, value: unknown): Promise<unknown>Parameters:
| Parameter | Type | Description |
|---|---|---|
| key | string | Record key. |
| value | unknown | Value used only when the key is absent. |
Returns: Promise<unknown> — The existing or newly committed value.