Skip to content

Clarity needed on resource use cases #59973

Closed as not planned
Closed as not planned

Description

@dapperdandev

Describe the problem that you experienced

The docs contain contradictions regarding the purpose of resources:

You can use a Resource to perform any kind of async operation, but the most common use-case for Resource is fetching data from a server. The following example creates a resource to fetch some user data.

https://angular.dev/guide/signals/resource

Note that resource is intended for read operations, not operations which perform mutations. resource will cancel in-progress loads via the AbortSignal when destroyed or when a new request object becomes available, which could prematurely abort mutations.

https://angular.dev/api/core/resource#description

Enter the URL of the topic with the problem

See description

Describe what you were looking for in the documentation

See description

Describe the actions that led you to experience the problem

Discussing resources with non-GET loaders

#58920

Describe what you want to experience that would fix the problem

Preferably, expand resource to consider mutations as a viable use-case. I understand this would require reconsidering the AbortSignal and it may be better suited for a separate API.

Regardless, the docs should be consistent.

Add a screenshot if that helps illustrate the problem

No response

If this problem caused an exception or error, please paste it here


If the problem is browser-specific, please specify the device, OS, browser, and version


Provide any additional information here in as much as detail as you can


Activity

  1. JeanMeche commented on Feb 16, 2025

    @JeanMeche
    Member

    This topic will be discussed/explained as part of an upcoming RFC (around the release of 19.2 in about 10 days).

  2. added
    area: docs
    on Feb 18, 2025
  3. added this to the needsTriage milestone on Feb 18, 2025
  4. JeanMeche commented on Feb 19, 2025

    @JeanMeche
    Member

    We'll update the docs when the RFC is closed an we have a better confidence on the shape of the APIs/features.

  5. angular-automatic-lock-bot commented on Mar 22, 2025

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  6. locked and limited conversation to collaborators on Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: docs

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions