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());

Package Sidebar

Install

npm i weaked

Weekly Downloads

8

Version

0.1.3

License

MIT

Unpacked Size

2.85 kB

Total Files

4

Last publish

Collaborators

  • jaenster