-
Notifications
You must be signed in to change notification settings - Fork 41
withResource
#214
New issue
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
withResource
#214
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Immediate round of things I noticed, will do at least one more at a deeper level in a bit
@@ -0,0 +1,321 @@ | |||
//** Types for `withResource` */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This meant to be moved down to the types?
Co-authored-by: michael-small <[email protected]>
edit: done it('can accept an rxResource', async () => {
const UserStore = signalStore(
{ providedIn: 'root' },
withState({ userId: 1 }),
withResource((store) =>
rxResource({
params: store.userId,
stream: ({ params: id }) => of(id + 1),
}),
),
);
const userStore = TestBed.inject(UserStore);
await wait();
expect(userStore.value()).toBe(2);
}); |
Oh, I pulled down your fork and tried to push up that commit fb77141 and assumed it would just open a PR to your fork. Oops, I didn't realize I could write directly to your fork's branch. Hope that change is good, I'll be careful next time knowing that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two things and it's good
- Verify that the change I accidentally committed directly to this is good with you (
build
andtest
are fine) - Please add something like that one
rxResource
test example somewhere, if not literally just that example. I suppose if you didn't mind I could just push it up too, apparently.
Otherwise, between this time and the times I have looked at the draft PR in the other repo, looks good to me.
No description provided.