-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$foo = $foo gets completely compiled away #2681
Comments
I believe this is just a matter of: diff --git a/src/compile/render-dom/index.ts b/src/compile/render-dom/index.ts
index ce2f3a00..0a0743b2 100644
--- a/src/compile/render-dom/index.ts
+++ b/src/compile/render-dom/index.ts
@@ -182,7 +182,7 @@ export default function dom(
if (node.operator === '=' && nodes_match(node.left, node.right)) {
const dirty = names.filter(name => {
- return scope.find_owner(name) === component.instance_scope;
+ return name[0] === '$' || scope.find_owner(name) === component.instance_scope;
});
if (dirty.length) component.has_reactive_assignments = true; Anything that begins with a |
variable name starting with $ mush be a store, is that your case? |
Variable names that begin with a |
fix instrumentation of auto-subscription self-assignments
If you've mutated and autosubscription value without an assignment being involved, it will now be out of date with the actual store. Presumably, this is how we want this to behave, and something like
$foo.push(whatever);
shouldn't get instrumented.Also presumably, the way to deal with this is to then do
$foo = $foo;
which will compile tofoo.set($foo);
, but currently that is getting compiled away into nothing.The text was updated successfully, but these errors were encountered: