This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useRef, useMemo } from "react"; | |
type Args = readonly unknown[]; | |
function usePartialCall<A extends Args, M extends Args, R>( | |
f: (...args: [...A, ...M]) => R, | |
...moreArgs: M | |
) { | |
const ref = useRef(moreArgs); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const message = "Hello, this is the message"; | |
const hash = new Uint8Array(await crypto.subtle.digest("SHA-256", new TextEncoder().encode(message))); | |
const base64 = btoa(String.fromCharCode(...hash))); |
OlderNewer