"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearIT
IT Crowd KaranGauswami 1 year ago 100%
What kind of Operating System does it use ? https://i.imgur.com/jlLoYId.jpg
3
0
typescript
TypeScript KaranGauswami 1 year ago 100%
How to use Disposable in Typescript 5.2 Beta

Typescript has [recently released](https://devblogs.microsoft.com/typescript/announcing-typescript-5-2-beta/) *using* keyword feature. I am trying the following code but not able to compile ```ts import fs from "node:fs"; class TempFile implements Disposable { #path: string; #handle: number; constructor(path: string) { this.#path = path; this.#handle = fs.openSync(path, "w+"); } // other methods [Symbol.dispose]() { // Close the file and delete it. fs.closeSync(this.#handle); fs.unlinkSync(this.#path); } } ``` It is giving this error. ```bash src/index.ts:2:27 - error TS2304: Cannot find name 'Disposable'. 2 class TempFile implements Disposable { ~~~~~~~~~~ src/index.ts:13:11 - error TS2339: Property 'dispose' does not exist on type 'SymbolConstructor'. 13 [Symbol.dispose]() { ~~~~~~~ ``` Any ideas ?

1
0
asklemmy Asklemmy [@asklemmy](https://lemmy.ml/c/asklemmy) !asklemmy@lemmy.ml People using Mastodon to follow Lemmy subs, how are you organizing your feeds?
Jump
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearIT
IT Crowd KaranGauswami 1 year ago 100%
Look normal
1
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearIT
IT Crowd KaranGauswami 1 year ago 100%
First post
1
0
himym
HIMYM KaranGauswami 1 year ago 100%
First Post
1
0