Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
brian-mcallister-lab49 opened this issue Apr 12, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@brian-mcallister-lab49
Copy link
Member

brian-mcallister-lab49 commented Apr 12, 2022

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} />; 
}
@brian-mcallister-lab49 brian-mcallister-lab49 added the enhancement New feature or request label Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant