Skip to content

Commit

Permalink
clarify README.
Browse files Browse the repository at this point in the history
  • Loading branch information
phulin committed Oct 21, 2024
1 parent 12ff637 commit ce171c7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit ce171c7

Please sign in to comment.