-
Notifications
You must be signed in to change notification settings - Fork 58
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
CPLAT-16997 Fix selector hooks redrawing when values haven't changed #730
Merged
+863
−247
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
64d087e
Fix selectors always returning new objects by conditionally wrapping …
greglittlefield-wf c01d310
Reuse wrapped functions
greglittlefield-wf 2c68978
Add regression tests
greglittlefield-wf 5e12f20
Fix missing arg causing swallowed RTEs
greglittlefield-wf 4dfb35d
Fix missing arg causing swallowed RTEs for createSelectorHook
greglittlefield-wf 656cfca
Add some shared tests for different selected value types
greglittlefield-wf df95525
Add test coverage for createSelector, add null case and additional se…
greglittlefield-wf d472036
Use typed props
greglittlefield-wf 498c594
Fix typo
greglittlefield-wf 2e74a56
Update typing from dynamic to Object to prevent unintentional implici…
greglittlefield-wf 4202bc5
Revert changes in old tests
greglittlefield-wf f4f3ae4
Remove unused dependency
greglittlefield-wf 5973053
Add more test coverage
greglittlefield-wf 2880847
Cleanup
greglittlefield-wf 7cee6c0
Add test coverage for value identity
greglittlefield-wf abe3425
Add additional test coverage for connect
greglittlefield-wf e7cabbd
Add comment
greglittlefield-wf b199497
Add useSelector example
greglittlefield-wf b55e993
Update doc comment to not get flagged by dependency_validator
greglittlefield-wf cb65a0e
Fix copyright headers
greglittlefield-wf 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
Cleanup
commit 2880847726843da8cf69dcef99259385700538b9
There are no files selected for viewing
This file contains 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 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,14 @@ | ||
import 'package:redux/redux.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
/// Dispatches an action on a redux store, waits for the store to emit an onChange event, | ||
/// and then waits for a [pumpEventQueue]. | ||
/// | ||
/// This can be used to dispatch an action and ensure it has been received by any subscribers, | ||
/// which is helpful for verifying that something _doesn't_ happen in response to a store update. | ||
Future<void> dispatchAndWait(Store store, dynamic action) async { | ||
final storeChangeFuture = store.onChange.first; | ||
store.dispatch(action); | ||
await storeChangeFuture.timeout(Duration(milliseconds: 100)); | ||
await pumpEventQueue(); | ||
} |
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.
These tests have moved to store_bindings_tests.dart. I started by refactoring them to use custom components so they could be run with multiple types of selected values, and they eventually morphed into tests that could also be shared with connect, thus the new file name.