Skip to content

Fix/improve types for Resource and For/Index/mapArray/indexArray#590

Merged
ryansolid merged 2 commits intosolidjs:mainfrom
otonashixav:fix-some-types
Aug 3, 2021
Merged

Fix/improve types for Resource and For/Index/mapArray/indexArray#590
ryansolid merged 2 commits intosolidjs:mainfrom
otonashixav:fix-some-types

Conversation

@otonashixav
Copy link
Contributor

@otonashixav otonashixav commented Aug 2, 2021

Some minor changes to types.

  1. Resource<T> still extended Accessor<T | undefined> despite other changes to createResource. This PR completes the fix intended in 85fe17b removing the undefined.
  2. Added falsy types to the each accessor in For, Index, mapArray and indexArray so that patterns such as <For each={resource()}> and <For each={store.nullable?.list}> work. I'm not sure if false is necessary here, but added it anyway for consistency with Show.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1089867614

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 90.541%

Totals Coverage Status
Change from base Build 1081230934: 0.0%
Covered Lines: 1065
Relevant Lines: 1127

💛 - Coveralls

@ryansolid ryansolid merged commit 8161f75 into solidjs:main Aug 3, 2021
@otonashixav otonashixav deleted the fix-some-types branch November 20, 2021 08:09
lilybw pushed a commit to lilybw/solid that referenced this pull request Nov 12, 2025
…rray` (solidjs#590)

* remove undefined from Resource<T> extends Accessor<T | undefined>

* make For and Index also accept falsy values for the each prop
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.

3 participants