open-index/open-npm huggingface dataset:
npm package: @matthewp/reactive-vt-router
Description: Usage:
Latest version: 0.0.3

# @matthewp/reactive-vt-router

Usage:

The basis is the `fromNavigation` observable which listens for `navigate` events. Pipe this into the `handle` function which does the rest.

```js
import { fromNavigate, handle } from '@matthewp/reactive-vt-router';

fromNavigate()
.pipe(
  handle()
)
.subscribe();
```

For full control don't use `handle`, but instead use each part. You can swap out the parts you don't need (for example remove `fetch` and `swap` and put your own DOM update where `swap` was).

```js
import {
  fromNavigate, intercept, fetch, startViewTransition, swap
} from '@matthewp/reactive-vt-router';

fromNavigate()
.pipe(
  intercept(),
  fetch(),
  startViewTransition(),
  swap(),
)
.subscribe();
```