https://github.com/douganderson444/hyperbee-svelte-component
Hyperbee bundled into a Svelte Component for use in the browser or other bundlers
https://github.com/douganderson444/hyperbee-svelte-component
Last synced: 3 months ago
JSON representation
Hyperbee bundled into a Svelte Component for use in the browser or other bundlers
- Host: GitHub
- URL: https://github.com/douganderson444/hyperbee-svelte-component
- Owner: DougAnderson444
- Created: 2021-02-06T16:20:48.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-02-12T14:11:48.000Z (over 4 years ago)
- Last Synced: 2025-02-25T14:36:10.300Z (3 months ago)
- Language: JavaScript
- Size: 179 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hyperbee-svelte-component
Want to use hyperbee in the browser?
Hyperbee bundled into a Svelte Component for use in the browser or other bundlers
# Use
```html
import { onMount } from "svelte";
import HyperbeeComponent from "hyperbee-svelte-component";let db
let opts = { keyEncoding: "utf-8", valueEncoding: "utf-8" };
let feed;
let display = true; // if you want to debug the component, default: falseonMount(async () => {
feed = store.get({ key }); // get a hypercore feed from a corestore or hyperspace instance
});{#if feed}
{/if}```
# Building
Run rollup to build the component
```
npm run build
```Under the hood it bundles with browserify first (can't get rollup to do it right due to cjs?)
This bundles all the `require('hyperbee')` for you and rolls it into the component.