weaked
v0.1.3
Published
weak decorator, wraps it with a WeakRef descriptor
Downloads
64
Maintainers
Readme
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());