Skip to main content

Documentation Index

Fetch the complete documentation index at: https://krono.fabianpiper.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Destroying the orderbook is an irreversible action for that specific instance. Use primarily when unmounting top-level providers.
This hook requires the OrderbookProvider to be present in your component tree to provide the underlying Orderbook instance.

Import

import { useOrderbookLifecycle } from '@krono/hooks'

Usage

import { useOrderbookLifecycle } from '@krono/hooks'

function AdminControls() {
  const { destroy } = useOrderbookLifecycle();

  return (
    <button onClick={destroy}>
      Destroy orderbook
    </button>
  );
}

Return Type

Actions

destroy
() => void
Disconnects the Websocket, clears the price maps, empties the history buffer, and removes all internal event listeners.

Orderbook Core

Explore the underlying class logic and event emitters.

useOrderbookConnection

Trigger connect/disconnect actions.

useOrderbookData

Access the live snapshot of the current orderbook.

Kraken API

Explore the book channel streams level 2 order book docs.