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

async abilities #160

Open
AmilKey opened this issue Jan 30, 2024 · 0 comments
Open

async abilities #160

AmilKey opened this issue Jan 30, 2024 · 0 comments

Comments

@AmilKey
Copy link

AmilKey commented Jan 30, 2024

Hello, the latest version breaks the async abilities

on this line "double negation" returns always true if result for this.valueFor is promise, the same happens in helpers so it is not possible to use with async helpers like (await (can ""))

https://github.com/minutebase/ember-can/blob/master/addon/services/abilities.js#L74

my suggestion is not to use "!!" operator and just return result

  can(abilityString, model, properties) {
    let { propertyName, abilityName } = this.parse(abilityString);
    return this.valueFor(propertyName, abilityName, model, properties);
  }

related #20

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