Skip to content

Commit 4552a43

Browse files
committed
Update change file
1 parent 0897d69 commit 4552a43

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
---
2-
"@tauri-apps/api": patch:enhance
2+
"@tauri-apps/api": minor:enhance
33
---
44

5-
Add ECMAScript Explicit Resource Management to Resource.
5+
Add ECMAScript Explicit Resource Management to Resource. You can now use the `using` syntax in supported browsers or with polyfills:
6+
7+
```javascript
8+
import { create, BaseDirectory } from "@tauri-apps/plugin-fs"
9+
...
10+
{
11+
await using file = await create("foo/bar.txt", { baseDir: BaseDirectory.AppConfig });
12+
await file.write(new TextEncoder().encode("Hello world"));
13+
// Before `file` goes out of scope, it is disposed by calling `file[Symbol.asyncDispose]()` and awaited.
14+
}
15+
```

0 commit comments

Comments
 (0)