Skip to content

Add ability to merge incoming order book data into the component. #49

@brian-mcallister-lab49

Description

@brian-mcallister-lab49

Expose functions to help add a price update into the order book. Something like (book: Book, update: BookUpdate) => Book, but possibly a class to maintain the book prices in a tree for efficient insert and deletes. See bintrees, and the RBTree.

This could also be written as a hook.

Here's a rough example of what this might look like:

import { OrderBook, mergeUpdates } from '@lab49/react-order-book';

const MyComponent = ({ bookData: Book, bookUpdate: BookUpdate }) => {
  const book = mergeUpdates(bookData, bookUpdate);

  return <OrderBook book={book} />; 
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions