From ce171c7e30381ac33e53498f14f235058446a109 Mon Sep 17 00:00:00 2001 From: Patrick Hulin Date: Mon, 21 Oct 2024 08:10:35 -0400 Subject: [PATCH] clarify README. --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index be5b81c..fab26b2 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,11 @@ Tome is a library written to support relay scripts for KoLmafia written in TypeScript with React. +It works as a drop-in replacement for the `kolmafia` typescript bindings, and allows use of `libram`. +Any `kolmafia` function call will return a placeholder value on the first call, and then silently +fetch the correct value in the background, triggering a UI refresh in React when that value arrives. +Essentially, `tome` goes for eventual UI consistency. + ## Install To get started, simply run `yarn add tome-kolmafia`. Afterwards, you'll need to do some @@ -16,8 +21,9 @@ The tome developers recommend using TypeScript and vite for your build system. After that, there's a little more work to be done before you can fully benefit. You'll need to wrap your App on some level (above wherever you want to run libram/kolmafia functions) with a `RefreshContextProvider`. Then the rest of your app should be in a subcomponent of that context -provider. By default, your app will refresh its data any time the main pane is navigated or -whenever key pieces of character state change. +provider. A top-level component in your app needs to then call `useContext(RefreshContext)`. +By default, your app will refresh its data any time the main pane is navigated orwhenever key +pieces of character state change. ## How to get your build system to treat tome-kolmafia as kolmafia