Skip to content

Instantly share code, notes, and snippets.

@m93a
Last active September 30, 2023 08:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m93a/d125111931d497750d2c41e8e62f1320 to your computer and use it in GitHub Desktop.
Save m93a/d125111931d497750d2c41e8e62f1320 to your computer and use it in GitHub Desktop.
Svelte Stores Toolkit

Primitive Stores

Readable

Derived Readable

Writable

Derived Writable


List Stores

Readable

  • get – returns the underlying array

Derived Readable

  • at, length, map, filter, every, some, slice, sorted
  • includes, indexOf, lastIndexOf, find, findLast, findIndex, findLastIndex
  • trackedItem, trackItemIndex, trackItemContent, trackedSlice
  • toSet
  • withHistory
  • withTransition

Writable

Derived Writable

  • at, withHistory
  • writableSlice, writableMap, writableTrackedItem

Set Stores

Readable

  • get – returns the underlying set

Derived Readable

Writable

Derived Writable

  • bindHas

Map Stores

Writable

Derived Writable


Pre-made Stores


Miscellaneous

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment