v1.0.0
Modern single resource management for deno π¦
Attributes
Includes Deno configuration
Repository
Current version released
11 months ago
Dependencies
deno.land/x
Versions
ready-resource
Modern single resource management
fork for deno π¦
Usage
import { ReadyResource } from 'https://deno.land/x/ready_resource@v1.0.0/mod.ts'
class Thing extends ReadyResource {
constructor() {
super()
}
async _open() {
// open the resource
}
async _close() {
// close the resource
}
}
const r = new Thing()
await r.ready() // calls _open once
await r.ready() // noop
await r.close() // calls _close after _open has finished
await r.close() // noop
License
MIT