wip add button and feed stuff
This commit is contained in:
parent
38d09a582c
commit
1c2d6d60a6
11 changed files with 211 additions and 46 deletions
|
@ -1,7 +1,9 @@
|
|||
import { useEffect, useState } from 'react'
|
||||
|
||||
export function useAsyncState<T>(loader: () => Promise<T>): T | undefined {
|
||||
const [state, setState] = useState<T>()
|
||||
export function useAsyncState<T>(loader: () => Promise<T>): T | undefined
|
||||
export function useAsyncState<T>(loader: () => Promise<T>, defaultValue: T): T
|
||||
export function useAsyncState<T>(loader: () => Promise<T>, defaultValue?: T): T | undefined {
|
||||
const [state, setState] = useState<T>(defaultValue as T)
|
||||
|
||||
useEffect(() => {
|
||||
setTimeout(async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue