Skip to content
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

[Chore] Create separate stream constructor for Resource #97

Conversation

manuel-plavsic
Copy link
Collaborator

This PR makes it simpler to work with Resource: the users are forced to provide the fetcher with the default constructor (like with SolidJS). In case the user wants to provide a stream, then a different constructor is needed. This way it becomes impossible to provide:

  • both stream and fetcher
  • none of them

By getting rid of the two scenarios above, type inference also becomes very accurate.

This PR introduced a breaking change, but I think it is fine, since v2 will bring other breaking changes as well.

Copy link

codecov bot commented Dec 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (91dc6b3) to head (5c61538).
Report is 1 commits behind head on dev.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               dev       #97   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines         1191      1194    +3     
=========================================
+ Hits          1191      1194    +3     
Files with missing lines Coverage Δ
packages/solidart/lib/src/core/resource.dart 100.00% <100.00%> (ø)

Copy link
Owner

@nank1ro nank1ro left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the PR 🙏

@nank1ro nank1ro merged commit 3358c62 into nank1ro:dev Dec 30, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants