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

Fix computeds using ownkeys #33

Merged
merged 4 commits into from
Jul 10, 2023
Merged

Conversation

luisherranz
Copy link
Owner

What

Avoid side-effects on the ownKeys trap.

Fixes #32.

Why

Because computeds don't allow side-effects.

How

Just replace the (...).value = ... asignment with a fake prop (...)._ = ... asignment.

@luisherranz luisherranz requested a review from DAreRodz July 4, 2023 08:37
@luisherranz luisherranz self-assigned this Jul 4, 2023
@luisherranz luisherranz marked this pull request as ready for review July 4, 2023 08:38
@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2023

Size Change: -5 B (0%)

Total Size: 6.2 kB

Filename Size Change
packages/deepsignal/core/dist/deepsignal-core.js 1.01 kB -1 B (0%)
packages/deepsignal/core/dist/deepsignal-core.mjs 1 kB -1 B (0%)
packages/deepsignal/dist/deepsignal.js 1.05 kB -1 B (0%)
packages/deepsignal/react/dist/deepsignal-react.js 1.05 kB -1 B (0%)
packages/deepsignal/react/dist/deepsignal-react.mjs 1.04 kB -1 B (0%)
ℹ️ View Unchanged
Filename Size
packages/deepsignal/dist/deepsignal.mjs 1.04 kB

compressed-size-action

Copy link
Collaborator

@DAreRodz DAreRodz left a comment

Choose a reason for hiding this comment

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

LGTM! ✅

@luisherranz
Copy link
Owner Author

Thanks, David!

@luisherranz luisherranz merged commit e4c103f into main Jul 10, 2023
@luisherranz luisherranz deleted the fix-computeds-using-ownkeys branch July 10, 2023 15:12
@luisherranz luisherranz restored the fix-computeds-using-ownkeys branch July 10, 2023 15:29
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.

Error computed side-effects error when accessing getter
2 participants