As a beginner in solidjs, I might have missed something important. In the code snippet below, I am trying to understand an issue:
const [state, setState] = createStore({ items: new Map() }); // e.g. Map<number, string>
In a component, suppose I want to use a derived state of the store like this:
export const Overview = () => {
const count = () => state.items.size;
return (<div>{count()</div>);
};
I expected that if I add a new entry to the map, the count property would be automatically updated since I am using it as a dependency.
I tried using an array instead of a map and it worked correctly, displaying the expected values in the component.
Could someone guide me to the relevant section in the documentation or explain why a map is not working as expected but an array does?