Skip to content

useDisconnectKernelClient

Hook for disconnecting kernel account client

Import

import { useDisconnectKernelClient } from '@zerodev/waas'

Usage

import { useDisconnectKernelClient } from '@zerodev/waas';
 
function App() {
  const { disconnect } = useDisconnectKernelClient();
 
  return (
    <button onClick={() => disconnect()}>
      Disconnect
    </button>
  )
}

Parameters

No parameter needed.

Return Types

import { type UseDisconnectKernelClientReturnType } from '@zerodev/waas'


TanStack Query mutation docs

disconnect

() => void

The mutation function to disconnect kernel client.

disconnectAsync

() => Promise<boolean>

Similar to disconnect but returns a promise.

data

boolean | undefined

  • Defaults to undefined
  • The last successfully resolved data for the mutation.

error

Error | null

The error object for the mutation, if an error was encountered.

isError / isIdle / isPending / isSuccess

boolean

Boolean variables derived from status.

isPaused

boolean

  • will be true if the mutation has been paused.
  • see Network Mode for more information.

status

'idle' | 'pending' | 'error' | 'success'

  • 'idle' initial status prior to the mutation function executing.
  • 'pending' if the mutation is currently executing.
  • 'error' if the last mutation attempt resulted in an error.
  • 'success' if the last mutation attempt was successful.

reset

() => void

A function to clean the mutation internal state (e.g. it resets the mutation to its initial state).