-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat: add onchange
option to $state
#15069
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
Open
paoloricciuti
wants to merge
63
commits into
main
Choose a base branch
from
state-onchange
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+771
−81
Open
Changes from 19 commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
d7876af
feat: add `onchange` option to `$state`
paoloricciuti 82d45a2
fix: create `assignable_proxy` utils to prevent declaring an external…
paoloricciuti e42c7cd
fix: move logic to proxy inside `set`
paoloricciuti 807ffbb
fix: only call `onchange` once for array mutations (#15073)
Rich-Harris 3353faf
chore: add tests for arrays
paoloricciuti 23df27f
chore: update types for `$state.raw`
paoloricciuti 07499da
fix: add options to `$state.raw` in classes
paoloricciuti 1fb57eb
docs: add docs for state options
paoloricciuti 4ed4351
fix: invoke `onchange` in component constructor
paoloricciuti e2c2580
fix: move `onchange` call right before inspect effects
paoloricciuti f013e87
fix: only batch array methods if there's an `onchange` function
paoloricciuti 37888f4
fix: move easier condition up
paoloricciuti c83d01c
fix: move `onchange` after `inspect` effects
paoloricciuti 4229776
Merge remote-tracking branch 'origin/main' into state-onchange
paoloricciuti 7fc930a
chore: bette phrasing for docs and error
paoloricciuti 7c215bf
fix: notify both `onchange` if proxy is passed into proxy
paoloricciuti ec77f8b
chore: add error for non-inline options
paoloricciuti d0d9a36
chore: add test for agglomerated `onchange`
paoloricciuti e237132
fix: correct types
paoloricciuti f16e445
chore: push failing test for extrapolated reference
paoloricciuti 316a341
fix: make it work properly with reassigned references
paoloricciuti 55fdccc
fix: make it work with reassigned `length`
paoloricciuti 873cd5f
fix: double log on push
paoloricciuti 35e2afe
fix: test for `simple_set` and `simple_set`
paoloricciuti 19acec4
Merge remote-tracking branch 'origin/main' into state-onchange
paoloricciuti df62dd6
Merge remote-tracking branch 'origin/main' into state-onchange
paoloricciuti 2a3fb7a
fix: lint and test
paoloricciuti 128c325
fix: remove source onchange from proxy on reassignment
paoloricciuti 3e886c7
fix: add extra check
paoloricciuti 25e03b3
fix: batch assignment to length of an array
paoloricciuti e1e372b
merge main
Rich-Harris 1b2719f
merge main
Rich-Harris 8d02009
Apply suggestions from code review
Rich-Harris 0d4add1
merge main
Rich-Harris 0b8d2fa
remove static analysis restriction
Rich-Harris a97465d
simplify
Rich-Harris e7fa79a
simplify
Rich-Harris c793cf3
simplify
Rich-Harris 51ecbef
oops
Rich-Harris b158c8c
unused
Rich-Harris ea75c5e
tidy up
Rich-Harris 954eb8d
merge main
Rich-Harris 3cb7b79
chore: split tests
paoloricciuti 35e4023
Update packages/svelte/tests/runtime-runes/samples/state-onchange-rea…
Rich-Harris 118e9aa
put flushSync calls on single line — makes it easier to connect the e…
Rich-Harris 36bfef9
not a proxy!
Rich-Harris 0fd4d2a
Merge branch 'main' into state-onchange
Rich-Harris 458ed29
Merge branch 'main' into state-onchange
Rich-Harris a33ff30
Merge branch 'main' into state-onchange
Rich-Harris 714c042
extract `onchange` callbacks from options (#15579)
Rich-Harris 9f34f7c
merge main
Rich-Harris af70cef
ValueOptions -> StateOptions
Rich-Harris bfa0883
Merge branch 'main' into state-onchange
Rich-Harris bde0252
tweak docs
Rich-Harris c4182f5
simplify
Rich-Harris 0e57669
cosmetic tweak
Rich-Harris 42f73a0
tweak conditions
Rich-Harris dbf2b4c
simplify
Rich-Harris d5f785b
add a failing test
Rich-Harris d8e60f0
fix
Rich-Harris 6c9380c
failing test
Rich-Harris ac05b73
fix
Rich-Harris cfd8ef2
merge main
Rich-Harris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'svelte': minor | ||
--- | ||
|
||
feat: add `onchange` option to `$state` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.