Skip to content
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

$notnil selector doesn't work #13

Open
borispoehland opened this issue Dec 9, 2022 · 0 comments
Open

$notnil selector doesn't work #13

borispoehland opened this issue Dec 9, 2022 · 0 comments

Comments

@borispoehland
Copy link

Hey,

The $notnil selector doesn't work, and I know why. In your code you have:

// when prop has no value, we pretent value is $nil to be able to kick off $nil hook later.
  if (isNil(correspondingSourceValue)) {
    correspondingSourceValue = $nil;
  }
  // ...
  if (!isNil(valueVariations[$notnil]) && !isNil(correspondingSourceValue)) {
    matchingVariations = [valueVariations[$notnil], matchingVariations].filter(Boolean).join(" ");
  }

Because you set correspondingSourceValue to $nil, the check !isNil(correspondingSourceValue) does not become true. Instead, you can check with !isNil(source[prop])

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

No branches or pull requests

1 participant