query icon indicating copy to clipboard operation
query copied to clipboard

Feature Request: Introduce a Signal-Based API Inspired by Angular Resource API

Open NetanelBasal opened this issue 1 year ago • 2 comments

Which @ngneat/query-* package(s) are relevant/releated to the feature request?

No response

Description

It would be valuable to introduce a new Signal-based API in this library, inspired by Angular's recently introduced Resource API. This would streamline data handling, making integration with Angular applications and reactive workflows more seamless.

Motivation

The Angular Resource API provides a clean and declarative approach to managing asynchronous data. Drawing inspiration from this, a similar API in this library could:

  • Simplify server state management with Signals.
  • Improve developer experience with a declarative approach.
  • Align better with Angular's modern architecture.

Proposal

Start with a proof of concept (POC) that supports the most commonly used TanStack Query APIs. For the initial implementation:

  • Focus on core functionalities such as useQuery.
  • Exclude advanced features like pagination and infinite queries for now to keep the POC manageable.

Benefits

  • Enables better integration with Angular Signals.
  • Enhances reactivity and improves state consistency.
  • Provides a solid foundation to expand into more advanced features like pagination and caching.

Let me know if you'd like me to adjust it further or add more technical details! 🚀

Proposed solution

.

Alternatives considered

.

Do you want to create a pull request?

No

NetanelBasal avatar Dec 17 '24 11:12 NetanelBasal

@luii FYI

NetanelBasal avatar Dec 17 '24 11:12 NetanelBasal

Resource api is just an inferior version of the query api, but maybe a style refactor could improve DX?

Ookamini95 avatar Jan 02 '25 11:01 Ookamini95