We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
useFeatureEntitlements
const foo = useFeatureEntitlements("bar");
foo is now, according to Typescript, of type Entitlement. During runtime, however, it is in fact a Ref<Entitlement>.
foo
Entitlement
Ref<Entitlement>
This causes problems when you're not directly using foo in the component html, but instead using it elsewhere in the script part.
script
You are then forced to do something like this:
(foo as unknown as Ref<typeof foo>).value.isEntitled (alternatively unref(foo).isEntitled)
(foo as unknown as Ref<typeof foo>).value.isEntitled
unref(foo).isEntitled
Proof:
console.log("checking entitlement"); console.log(foo.isEntitled); console.log((foo as unknown as Ref<typeof foo>).value.isEntitled);
Outputs:
In this case, the user is indeed entitled, so true is the correct output.
true
Similar to #349
The text was updated successfully, but these errors were encountered:
@hognevevle Thanks for reporting the issue. We will take a look and update.
Sorry, something went wrong.
Fixed in 3.0.14
3.0.14
Thanks @doregg , but it seems the typings disappeared after this change (now returning any instead). 🤔
any
npmjs.com confirms the same:
@doregg Can you please reopen this? The types are still gone as of 3.0.19.
3.0.19
aviadmizrachi
frontegg-david
No branches or pull requests
const foo = useFeatureEntitlements("bar");
foo
is now, according to Typescript, of typeEntitlement
.During runtime, however, it is in fact a
Ref<Entitlement>
.This causes problems when you're not directly using
foo
in the component html, but instead using it elsewhere in thescript
part.You are then forced to do something like this:
(foo as unknown as Ref<typeof foo>).value.isEntitled
(alternatively
unref(foo).isEntitled
)Proof:
Outputs:
In this case, the user is indeed entitled, so
true
is the correct output.Similar to #349
The text was updated successfully, but these errors were encountered: