You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This never completes despite state being updated (see screenshot below). If the filter is removed it only emits undefined, false and never logs true for hasError()
It can be resolved by using this.productService.hasError(badProductCode, DEFAULT_SCOPE) instead, but it's not immediately obvious.
It seems hasError(productCode) will never select a valid scope unless the user has intentionally passed '' as a scope when fetching a product.
Expected behavior
I would expect that omitting scope for the status functions uses the same DEFAULT_SCOPE constant as get().
Screenshots
The loading and error states are updated under the default entity in redux.
Desktop:
OS: All
Browser: All
Version: All
Additional context
Perhaps this is not a bug but more of an API quirk which could catch people out. Since '' is not a scope used or exported by ProductScope it seems unintentional.
The text was updated successfully, but these errors were encountered:
Describe the bug
When omitting the scope parameter to
isLoading()
,isSuccess()
orhasError()
it does not use the same scope asget()
Tell us the version of Spartacus
To Reproduce
Set up an observable to fetch a non-existing product like below.
This never completes despite state being updated (see screenshot below). If the filter is removed it only emits
undefined, false
and never logstrue
forhasError()
ProductService uses
DEFAULT_SCOPE
forget()
when it's omitted but''
for the other functions.It can be resolved by using
this.productService.hasError(badProductCode, DEFAULT_SCOPE)
instead, but it's not immediately obvious.It seems
hasError(productCode)
will never select a valid scope unless the user has intentionally passed''
as a scope when fetching a product.Expected behavior
I would expect that omitting scope for the status functions uses the same
DEFAULT_SCOPE
constant asget()
.Screenshots
The loading and error states are updated under the
default
entity in redux.Desktop:
Additional context
Perhaps this is not a bug but more of an API quirk which could catch people out. Since
''
is not a scope used or exported by ProductScope it seems unintentional.The text was updated successfully, but these errors were encountered: