ionic-team/stencil-store

Nested store objects not being reset to it's initial state

perkrlsn opened this issue · 2 comments

When using nested objects as part of your store, calling store.reset() will not reset the nested objects to their respective initial state values.

e.g.

interface SomeStore {
  test1: {
    value: boolean;
  },
  test2: boolean;
}

const store = createStore<SomeStore>({
  test1: {
    value: false,
  },
  test2: false
});

Same problem as this issue: #55

Will need to add some docs in the README about initial.

Other option is letting the user to provide a function that we would run to obtain the initial value, but that can open new problems as well.

@Serabe So, with that said. Do you think this is something that will get supported?