npm install -S svelte-marina-button
// or with yarn
yarn add svelte-marina-button
Add to your svelte app
import Connect, { marinaStore, MarinaStore } from 'svelte-marina-button';
// You can subscribe to marina status changes
marinaStore.subscribe((s: MarinaStore) => {
console.log(s.network);
console.log(s.installed);
});
// you can pass optional cssClass to style your button
<Connect cssClass={'special-button-css'} />;
Test the library with an example page
yarn dev
# or start the server and open the app in a new browser tab
yarn dev -- --open
Before creating a production version of your app, install an adapter for your target environment. Then:
yarn build
You can preview the built app with
yarn preview
, regardless of whether you installed an adapter. This should not be used to serve your app in production.
- Increment the version and commit
npm version patch
- Package the library
npm run package
Now you can publish to NPM registry entering the package
folder and running npm publish