Skip to content

Commit

Permalink
More docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JAForbes committed Feb 15, 2024
1 parent e8e0ca0 commit beabe97
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions readme.md
Expand Up @@ -70,6 +70,10 @@ superhistory(
): superhistory.Instance
```

Creates a superhistory instance. You can optionally pass in `onChange` to be notified any time a path is set, or `popstate` fires

The `_window` parameter there is available as an override for serverside usage or tests. For example you could use JSDOM.

### `instance.get()`

```typescript
Expand Down Expand Up @@ -134,6 +138,10 @@ Create a nested istory context. All history operations will receive/return a lo

These operations are applied directly to the history API by the child instance using the concatenated prefixes of all of its parents.

You can also optionally provide an onChange callback which will notify you when a route is set or on `onpopstate`.

Note there is no diffing for `onChange` callbacks, if any route instance updates all route instances get notified that the URL is being changed.

## Utilities

### `superhistory.joinPath`
Expand Down

0 comments on commit beabe97

Please sign in to comment.