Skip to content

Commit

Permalink
chore: use complete words, less cognitive load
Browse files Browse the repository at this point in the history
  • Loading branch information
JaimeTorrealba committed Aug 21, 2023
1 parent db192a5 commit adcc8dc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/loaders/useVideoTexture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export async function useVideoTexture(src: string | MediaStream, options?: Parti
}

function loadTexture(): Promise<VideoTexture> {
return new Promise((res, rej) => {
return new Promise((resolve, reject) => {
const video = Object.assign(document.createElement('video'), {
src: (typeof src === 'string' && src) || undefined,
crossOrigin,
Expand All @@ -58,8 +58,8 @@ export async function useVideoTexture(src: string | MediaStream, options?: Parti
...rest,
})
const texture = new VideoTexture(video)
video.addEventListener(unsuspend, () => res(texture))
video.addEventListener('error', () => rej())
video.addEventListener(unsuspend, () => resolve(texture))
video.addEventListener('error', () => reject())
return texture
})
}
Expand Down

0 comments on commit adcc8dc

Please sign in to comment.