Skip to content

feat: widen withResource to Resource beyond ResourceRef - #301

Open
michael-small wants to merge 3 commits into
mainfrom
feat-withResource-take-Resource-type
Open

feat: widen withResource to Resource beyond ResourceRef#301
michael-small wants to merge 3 commits into
mainfrom
feat-withResource-take-Resource-type

Conversation

@michael-small

@michael-small michael-small commented Apr 24, 2026

Copy link
Copy Markdown
Collaborator

Issue: #292

@michael-small michael-small self-assigned this Apr 24, 2026
@michael-small michael-small added the enhancement New feature or request label Apr 24, 2026
@michael-small
michael-small marked this pull request as ready for review April 24, 2026 00:44
withProps,
} from '@ngrx/signals';

// TODO - add other specifics of HttpResourceRef (headers, statusCode, progress)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be done in this PR? Or a separate PR?

I will already have a separate PR for exposing snapshot as we discussed in a different PR

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would really prefer is we could this an a separate, as I would also see this is a more generic feature. For example it should also allow to expose resource types which we aren't even aware of.

Comment thread libs/ngrx-toolkit/src/lib/with-resource.spec.ts
@michael-small
michael-small marked this pull request as draft April 27, 2026 00:26
@michael-small

Copy link
Copy Markdown
Collaborator Author

Draft again: need to make the Resource not patchable

@michael-small
michael-small marked this pull request as ready for review May 4, 2026 17:18
@michael-small
michael-small requested review from rainerhahnekamp and removed request for rainerhahnekamp May 12, 2026 04:02

@rainerhahnekamp rainerhahnekamp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should the generic resource feature (see comments) in a separate issue

Comment thread libs/ngrx-toolkit/src/lib/with-resource.ts
Comment thread libs/ngrx-toolkit/src/lib/with-resource.ts Outdated
withProps,
} from '@ngrx/signals';

// TODO - add other specifics of HttpResourceRef (headers, statusCode, progress)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would really prefer is we could this an a separate, as I would also see this is a more generic feature. For example it should also allow to expose resource types which we aren't even aware of.

Comment thread libs/ngrx-toolkit/src/lib/with-resource.ts Outdated
Comment thread libs/ngrx-toolkit/src/lib/with-resource.spec.ts
@michael-small
michael-small force-pushed the feat-withResource-take-Resource-type branch from 71fc0f6 to b94e490 Compare May 30, 2026 21:07
@michael-small

Copy link
Copy Markdown
Collaborator Author

@rainerhahnekamp I have to make some changes so that withEntityResource can access the value. For now I am once again making this a draft so that it is reviewable as-is

@michael-small
michael-small marked this pull request as draft May 31, 2026 16:58
@michael-small

michael-small commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator Author

@rainerhahnekamp

Provided the following method in a new branch for withEntityResource is fine, then this PR for just withResource should be fine for a full review again: 12ab13f#diff-77761f53f54f331f4b8c0fbd69af8150a1a1a790ac0ccc553522b6da66ffef4bR155

@michael-small
michael-small marked this pull request as ready for review June 1, 2026 02:36
@michael-small
michael-small requested review from rainerhahnekamp and removed request for rainerhahnekamp June 6, 2026 20:55
);
}

export function isResourceRef(value: unknown): value is ResourceRef<unknown> {

@msmallest msmallest Sep 8, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michael-small
michael-small force-pushed the feat-withResource-take-Resource-type branch from 997a066 to 39eaa74 Compare September 14, 2026 01:35
@michael-small
michael-small force-pushed the feat-withResource-take-Resource-type branch from 39eaa74 to ed018f5 Compare September 14, 2026 01:56
@michael-small

Copy link
Copy Markdown
Collaborator Author

The state of the feature is ready for review. That said, I am adding tests for the extensions branch off of this to need to pass the type assertion, while still resolving to the right values which are applicable to this branch on its own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants