UNPKG

@sanity/client

Version:

Client for retrieving, creating and patching data from Sanity.io

15 lines (13 loc) 271 B
import type {Any} from '../types' export function once(fn: Any) { let didCall = false let returnValue: Any return (...args: Any[]) => { if (didCall) { return returnValue } returnValue = fn(...args) didCall = true return returnValue } }