Open History to see the last commit
1type EnvOnlyFn = <TFn extends (...args: Array<any>) => any>(fn: TFn) => TFn
2β
3// A function that will only be available in the server build
4// If called on the client, it will throw an error
5export const createServerOnlyFn: EnvOnlyFn = (fn) => fn
6β
7// A function that will only be available in the client build
8// If called on the server, it will throw an error
9export const createClientOnlyFn: EnvOnlyFn = (fn) => fn