-
Notifications
You must be signed in to change notification settings - Fork 392
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
feat(engine): issue #153 adds a mechanism for LDS to create readonly obj #154
Conversation
…e readonly obj
Benchmark comparisonBase commit:
|
Benchmark comparisonBase commit:
|
@@ -52,7 +52,7 @@ export const unwrap = getKey ? | |||
: (replicaOrAny: any): any => (replicaOrAny && replicaOrAny[TargetSlot]) || replicaOrAny; | |||
|
|||
export function isObservable(value: any): boolean { | |||
if (!value) { | |||
if (value == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't sufficient. We need to check for undefined
because getPrototypeOf(undefined)
throws.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is ==
, which means it checks for null
and undefined
without coercion.
This PR introduces a preliminary way for LDS and other libs to create qualifying objects that can be consumed by LWC (without a degradation), and at the same time, facilitate the creation of
readonly
andtrack
objects in those libraries without the double proxification.Does this PR introduce a breaking change?
Features
readonly
method that can be imported from"engine"
.track
as a method, instead of just being a decorator.Invariants