S
SolidJSā€¢15mo ago
bigmistqke

createMemo with `equals: false` not reactive when mutating reference

I am trying to prevent to create DOMMatrix with each calculation, so I thought to mutate 1 with createMemo(() => ..., {equals: false}), assuming it would trigger all subscriptions even when returning the same value (in this case the mutated DOMMatrix), but it doesn't as you can see: https://playground.solidjs.com/anonymous/1a137694-7267-439b-a7d3-8164a541e800 Anybody an idea how to approach this?
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
3 Replies
bigmistqke
bigmistqkeā€¢15mo ago
Mm, it doesn't work with primitives either like
const memo = createMemo(
() => {
dep()
return 0;
},
{equals: false}
);
const memo = createMemo(
() => {
dep()
return 0;
},
{equals: false}
);
https://playground.solidjs.com/anonymous/69e08a25-b614-43eb-b537-1c8faf5d2566 šŸ¤” bug?
thetarnav
thetarnavā€¢15mo ago
options go to the 3rd param 2nd is the initial value
bigmistqke
bigmistqkeā€¢15mo ago
sweet thanks šŸ™ šŸ™