Comparing version 0.1.5 to 0.1.6
@@ -15,3 +15,3 @@ declare type Notify = () => void; | ||
reject(error: Error): AsyncMutableRefObject<T>; | ||
freeze(): this; | ||
freeze(): AsyncMutableRefObject<T>; | ||
isFrozen(): boolean; | ||
@@ -18,0 +18,0 @@ } |
{ | ||
"name": "async-ref", | ||
"description": "Async ref objects for React. A tiny bridge between React.useSyncExternalStore and React.Suspense.", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "module": "dist/index.mjs", |
@@ -30,3 +30,3 @@ type Notify = () => void; | ||
#resolve: (value: T) => void = (value) => { | ||
#resolve = (value: T): void => { | ||
this.#state = { status: Status.Success, value, error: null }; | ||
@@ -36,3 +36,3 @@ this.#notify(); | ||
#reject: (error: Error) => void = (error) => { | ||
#reject = (error: Error): void => { | ||
this.#state = { status: Status.Error, value: null, error }; | ||
@@ -116,3 +116,3 @@ this.#notify(); | ||
public freeze() { | ||
public freeze(): AsyncMutableRefObject<T> { | ||
this.#frozen = true; | ||
@@ -125,3 +125,3 @@ this.#resolve = () => {}; | ||
public isFrozen() { | ||
public isFrozen(): boolean { | ||
return this.#frozen; | ||
@@ -128,0 +128,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
28062