weaked
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

Weakrefs as decorator

class Foo {
    @Weaked()
    bar: Bar;

    constructor(bar) {
       this.bar = bar;
    }
}

class Bar {
    baz() {
        return 5;
    }
}

const foo = new Foo(bar);

// This is derefed automaticly for your ease of coding
console.log(foo.bar?.baz());

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.3
    22
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.3
    22
  • 0.1.2
    0
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i weaked

Weekly Downloads

22

Version

0.1.3

License

MIT

Unpacked Size

2.85 kB

Total Files

4

Last publish

Collaborators

  • jaenster