import { useEffect } from 'react'
import type { GameAction } from './actions'
import { subscribe } from './inputBus'

export function useGameInput(onAction: (action: GameAction) => void): void {
  useEffect(() => subscribe(onAction), [onAction])
}
