We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0897d69 commit 4552a43Copy full SHA for 4552a43
.changes/explicit-resource-management.md
@@ -1,5 +1,15 @@
1
---
2
-"@tauri-apps/api": patch:enhance
+"@tauri-apps/api": minor:enhance
3
4
5
-Add ECMAScript Explicit Resource Management to Resource.
+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