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
query
I'm having this abstract method:
abstract getStuff$( ): ObservableQueryResult<Result, Error>;
I would like to implement it this way :
getStuff$() { return of(createSuccessObserverResult({ key: "value" })); }
But I cannot because createSuccessObserverResult has the following signature:
createSuccessObserverResult
export declare function createSuccessObserverResult<T>(data: T): QueryObserverResult<T>;
While I would need
export declare function createSuccessObserverResult<T, Error = DefaultError>(data: T): QueryObserverResult<T, Error>;
In order to comply with my abstract method.
Just expose the Error in the util @ngneat\query\lib\utils.d.ts :
@ngneat\query\lib\utils.d.ts
export declare function createSuccessObserverResult<T, Error = DefaultError>(data: T): QueryObserverResult<T, Error>; export declare function createPendingObserverResult<T = unknown, Error = DefaultError>(): QueryObserverResult<T, Error>;
The workaround is to force typing the return :
createSuccessObserverResult<T>(data) as QueryObserverResult<T, Error>;
No
The text was updated successfully, but these errors were encountered:
query/src/lib/utils.ts
Sorry, something went wrong.
You are welcome to create a PR
Fixed in #175
No branches or pull requests
Which @ngneat/query-* package(s) are relevant/releated to the feature request?
query
Description
I'm having this abstract method:
I would like to implement it this way :
But I cannot because
createSuccessObserverResult
has the following signature:While I would need
In order to comply with my abstract method.
Proposed solution
Just expose the Error in the util
@ngneat\query\lib\utils.d.ts
:Alternatives considered
The workaround is to force typing the return :
Do you want to create a pull request?
No
The text was updated successfully, but these errors were encountered: