File size: 233 Bytes
82d1e90
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
import { useRef } from "react"

import { useStore } from "@/app/store"

export function useIsBusy() {
  const isBusy = useStore(s => s.isBusy)
  const busyRef = useRef(isBusy)
  busyRef.current = isBusy

  return {isBusy, busyRef }
}