Note: this rough draft has turned into https://github.com/maxogden/art-of-node#art-of-node
go to https://github.com/maxogden/art-of-node#art-of-node to view the newer versions of this document
| import {readable, writable} from 'svelte/store'; | |
| // could be its own module | |
| const util = { | |
| _root: null, | |
| // similar to createSelector but instead returns a reactive variable | |
| createGetter(store, fn, initialData) { | |
| return readable(initialData, set => { | |
| store.subscribe(state => set(fn(state, this._root))); |
go to https://github.com/maxogden/art-of-node#art-of-node to view the newer versions of this document