Skip to main content

Store

The store in a FreeSewing pattern provides shared key-value storage. If you have some information in one part that you want to make available outside that part (to share it with another part) you can save it to the store.

There are two types of stores:

  • A pattern-wide store that is shared across all parts in all sets
  • A store per set that is shared across parts in that set

When you interact with a store in your part code, it is almost certainly the so-called setStore, the store that is shared across parts in the set.

The pattern-wide store is used for pattern initialization and storing logs and other data in the early stages of the pattern lifecycle.

Part APart BPart CPart DPart ESetStore 0StorePattern with a single sets of settingsSet 0 Part ASet 0 Part BSet 0 Part CSet 0 Part DSet 0 Part ESet 1 Part ASet 1 Part CSet 1 Part CSet 1 Part BSet 1 Part ESet 1 Part BSet 1 Part CSet 1 Part EStack AStack BStack CStack DStack ESetStore 0SetStore 1SetStore 2SetStore 3StorePattern with multiple sets of settings

An overview of different stores within a pattern