Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/westtrade/data-store


https://github.com/westtrade/data-store

Last synced: 1 day ago
JSON representation

Awesome Lists containing this project

README

        

# DataStore for svelte

## Example

```js
const DataStore = require('@westtrade/data-store')

const someStore = new DataStore(() =>
fetch('http://some-api.js/api.json').then(res => res.json())
)

someStore.sync()

module.exports = someStore
```

```svelte

import someStore from './someStore'

{#if $someStore.loading}


Loading...

{: else}

{ JSON.stringify($someStore) }

{/if}
```