Repository navigation
Conversation
Store binds its methods so they can be destructured, but ReadonlyStore did not, so a destructured get or subscribe from a derived store threw because `this` was undefined.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
🦋 Changeset detectedLatest commit: 2ff535b The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🎯 Changes
Storebindsget,setStateandsubscribein its constructor so they can be destructured, butReadonlyStoredoes not. A derived store fromcreateStore(() => ...)is aReadonlyStore, so this throws:This binds
getandsubscribeonReadonlyStorethe same way, and adds a test for a destructured derived store.✅ Checklist
pnpm test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit
getandsubscribemethods from read-only stores now work correctly, matching the behavior available on regular stores.