Skip to content

Commit

Permalink
Update README to fix importing the toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
msfstef committed Apr 24, 2024
1 parent da3bd61 commit 7425a75
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions components/toolbar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,15 @@ Add the toolbar to your project's `devDependencies` in `package.json`
}
```

First some imports

```typescript
import { addToolbar } from '@electric-sql/debug-toolbar'
import '@electric-sql/debug-toolbar/dist/index.cjs.css'
```

Then in your code after calling `electrify` pass the electric client into `addToolbar`:
In your code after calling `electrify`, if in debug mode, import and pass the electric client into `addToolbar`:

```typescript
const electric = await electrify(conn, schema, config)
addToolbar(electric)

if (config.debug) {
import('@electric-sql/debug-toolbar')
.then(({ addToolbar }) => addToolbar(electric))
}
```

This will add the toolbar to the bottom of your window
Expand Down

0 comments on commit 7425a75

Please sign in to comment.