Skip to content

This project adds the ability to use Redux Dev tools to visualise a Svelte store. It uses redux under the hood and should only be used in a development environment.

License

Notifications You must be signed in to change notification settings

GarethOates/svelte-dev-store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Svelte Dev Store

npm npm Twitter Follow

This project allows you to use the Redux Dev Tools browser plugin when working with a Svelte store instance.

To use this package in your project as you develop, you simply import this package instead of the svelte/store and create an instance of the exported class, instead of 'Store'.

import SvelteDevStore from 'svelte-dev-store';

const myStore = new SvelteDevStore({name: 'Gareth'});

myStore.set({name: 'Bob'});
myStore.set({name: 'Jim'});
myStore.set({name: 'Jeff'});

Then when you open up the Redux dev tools, you should see 3 newState actions and the chart should show the structure of your svelte store.

svelteDevStore has the exact same API as the actual svelte/store. It just extends it to incorporate sending actions to a very simple redux store, that enables you to see it in the dev tools.

About

This project adds the ability to use Redux Dev tools to visualise a Svelte store. It uses redux under the hood and should only be used in a development environment.

Topics

Resources

License

Stars

Watchers

Forks

Packages