Skip to content

Commit 41a8885

Browse files
committed
docs(use-storage): document empty string preservation behavior
1 parent 173541d commit 41a8885

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

apps/docs/src/pages/composables/plugins/use-storage.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ The `get()` method returns reactive refs that sync with storage automatically.
137137
> [!TIP] Auto-persistence
138138
> Refs returned by `get()` are watched with `{ deep: true }`. Any changes to the ref value automatically persist to storage.
139139
140+
> [!TIP] Empty strings are preserved
141+
> `get()` uses nullish coalescing (`??`) internally, so an empty string `''` is a valid stored value — it is never treated as absent or replaced by the default. Only `null` and `undefined` trigger the default.
142+
140143
## Examples
141144

142145
::: example

0 commit comments

Comments
 (0)