Closed jviide closed 3 months ago
Latest commit: 18fa480b6c596edf7a2a750efc0f77084a64e6dc
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
[Click here if you're a maintainer who wants to add a changeset to this PR](https://github.com/jviide/signals/new/inline-cycle-errors?filename=.changeset/sour-pears-rescue.md&value=---%0A%22%40preact%2Fsignals-core%22%3A%20patch%0A---%0A%0Arefactor%3A%20inline%20cycle%20errors%20%26%20use%20a%20shared%20.peek()%20implementation%20for%20signals%20and%20computeds%0A)
Name | Link |
---|---|
Latest commit | 18fa480b6c596edf7a2a750efc0f77084a64e6dc |
Latest deploy log | https://app.netlify.com/sites/preact-signals-demo/deploys/65f245ee1bc1930008865160 |
Deploy Preview | https://deploy-preview-526--preact-signals-demo.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
This pull request
cycleDetected
function. The downside is that the error message is now repeated in multiple places of the codebase. The next change helps with this by removing one of these repeats.Signal.prototype.peek
that works for both Signal and Computed instances, so that the specializedComputed.prototype.peek
implementation can be removed. This also removes one place wherecycleDetected
was used.A couple of new tests are included to test that computeds'
peek()
still throws errors when the computed function fails.In aggregate these changes save between 10 and 29 bytes, depending on the output format: