Add .weakRef() (#165)
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
This commit is contained in:
parent
06d217f70c
commit
e503a9ec49
4 changed files with 23 additions and 2 deletions
|
|
@ -49,3 +49,8 @@ export interface ObservableLike {
|
|||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
export type Falsy = false | 0 | 0n | '' | null | undefined;
|
||||
|
||||
export interface WeakRef<T extends object> { // eslint-disable-line @typescript-eslint/ban-types
|
||||
readonly [Symbol.toStringTag]: 'WeakRef';
|
||||
deref(): T | undefined;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue