Skip to content

Modern single resource management for deno 🦕

License

Notifications You must be signed in to change notification settings

algosail/ready-resource

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Modern single resource management for deno 🦕

Resources

License

Stars

Watchers

Forks

Languages

  • TypeScript 100.0%