Skip to content

fix(state): unsub to subscribed context on disconnect #49

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

Merged
merged 12 commits into from
Nov 12, 2024

Conversation

rax-it
Copy link
Contributor

@rax-it rax-it commented Nov 7, 2024

No description provided.

@rax-it rax-it force-pushed the rave/unsub-context branch from c8fc5c2 to d3593fb Compare November 7, 2024 19:54
@rax-it rax-it marked this pull request as ready for review November 7, 2024 22:33
@rax-it rax-it changed the title fix: unsub context fix(state): unsub to subscribed context on disconnect Nov 7, 2024
@rax-it rax-it requested a review from divmain November 7, 2024 22:36
@rax-it
Copy link
Contributor Author

rax-it commented Nov 12, 2024

It seems we can't do

hideChild = false; instead of showChild = !false;

because then the template will look like:

<template lwc:if={!hideChild}>

which is also not allowed in lwc because of

[CompilerError: Invalid expression {!showChild} - LWC1060: Template expression doesn't allow UnaryExpression] {
  level: 1,
  code: 1060,
  filename: 'contextParent.html',
  location: { line: 3, column: 13, start: 41, length: 19 }
}

@rax-it rax-it requested a review from divmain November 12, 2024 18:37
@@ -4,7 +4,7 @@
"module": "nodeNext",
"moduleResolution": "nodeNext",
"esModuleInterop": false,
"target": "ES2021",
"target": "ES2023",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required to use non-registered symbols as WeakMap keys, more details here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted to es2021, as per our discussion

@rax-it rax-it requested a review from divmain November 12, 2024 23:23
@rax-it rax-it merged commit bd4cf55 into main Nov 12, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants