This file contains hidden or 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
'use client'; | |
import { useState, useRef, useMemo, useTransition, useCallback, useEffect } from 'react'; | |
export type ServerAction = (...args: any[]) => Promise<any>; | |
export type Input<T extends ServerAction> = Parameters<T>; | |
export type Output<T extends ServerAction> = ReturnType<T> extends Promise<infer R> ? R : never; | |
type ServerActionType<T extends ServerAction, Value> = { | |
data: Value; |
This file contains hidden or 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 { | |
createContext, | |
ReactNode, | |
useCallback, | |
useContext, | |
useEffect, useMemo, | |
useRef, | |
useState | |
} from "react"; | |
import {Channel, Presence, Socket} from "phoenix"; |