-
Notifications
You must be signed in to change notification settings - Fork 3
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
refactor(cascadeReducer): Quick feedback 2 #430
Conversation
|
||
// App dependencies | ||
import { DatasetMetadata as IDatasetMetadata } from "../common/types/entities"; | ||
|
||
/* | ||
Action dispatched on successful response from dataset-metadata endpoint. | ||
*/ | ||
export interface DatasetMetdataAction extends Action<string> { | ||
export interface DatasetMetadataAction extends Action<string> { |
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.
I use https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker to catch typos 🤖 ✅ !
Codecov Report
@@ Coverage Diff @@
## atar/type-cascade #430 +/- ##
==================================================
Coverage 75.86% 75.86%
==================================================
Files 90 90
Lines 6778 6778
==================================================
Hits 5142 5142
Misses 1636 1636
Flags with carried forward coverage won't be shown. Click here to find out more. 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
* test * update cascade reducer * add map as possible type for cascade * refactor(cascadeReducer): Quick feedback (#427) * revert changes * Update client/src/reducers/cascade.ts Co-authored-by: Severiano Badajoz <[email protected]> * remove as string * refactor(cascadeReducer): Quick feedback 2 (#430) Co-authored-by: atarashansky <[email protected]> Co-authored-by: Timmy Huang <[email protected]> Co-authored-by: Severiano Badajoz <[email protected]>
* chore: updating logo (#389) * chore: updating logo * feature: Added loading spinner to geneset average color-by and fixed a continuous legend bug (#384) * added loading spinner to mean colorby and fixed legend async bug * revert prettier * temp fix tsc emit * typed * fix * fixed bugs Co-authored-by: atarashansky <[email protected]> * typed obs crossfilter (#420) Co-authored-by: atarashansky <[email protected]> * typed categorical selection reducer (#417) Co-authored-by: atarashansky <[email protected]> * typed differential reducer (#419) Co-authored-by: atarashansky <[email protected]> * typed annoMatrix reducer (#416) Co-authored-by: atarashansky <[email protected]> * chore: purge autosave from codebase (#425) * chore: typed genesetsUI reducer * fix tsc error * chore: purge autosave * delete nameNewAnnotation * remove unused Co-authored-by: atarashansky <[email protected]> * chore: typed controls reducer (#418) * typed controls reducer * refine scatterplot accessor type to be string or false * address revisions * type level return function Co-authored-by: atarashansky <[email protected]> * typed point dilation (#421) Co-authored-by: atarashansky <[email protected]> * Revert "feat: add cellxgene schema 3.0.0 fields to Standard Categories (#412)" (#428) This reverts commit b265fcf. * typed graph selection reducer (#422) Co-authored-by: atarashansky <[email protected]> * chore: typed cascade reducer (#426) * test * update cascade reducer * add map as possible type for cascade * refactor(cascadeReducer): Quick feedback (#427) * revert changes * Update client/src/reducers/cascade.ts Co-authored-by: Severiano Badajoz <[email protected]> * remove as string * refactor(cascadeReducer): Quick feedback 2 (#430) Co-authored-by: atarashansky <[email protected]> Co-authored-by: Timmy Huang <[email protected]> Co-authored-by: Severiano Badajoz <[email protected]> * chore: typed genesetsUI reducer (#423) * chore: typed genesetsUI reducer * fix tsc error Co-authored-by: atarashansky <[email protected]> * chore: typed config reducer (#424) * chore: typed config reducer * restrict error type Co-authored-by: atarashansky <[email protected]> Co-authored-by: ashin-czi <[email protected]> Co-authored-by: atarashansky <[email protected]> Co-authored-by: atarashansky <[email protected]> Co-authored-by: Nayib Gloria <[email protected]> Co-authored-by: Timmy Huang <[email protected]> Co-authored-by: Severiano Badajoz <[email protected]>
* chore: updating logo (#389) * chore: updating logo * feature: Added loading spinner to geneset average color-by and fixed a continuous legend bug (#384) * added loading spinner to mean colorby and fixed legend async bug * revert prettier * temp fix tsc emit * typed * fix * fixed bugs Co-authored-by: atarashansky <[email protected]> * typed obs crossfilter (#420) Co-authored-by: atarashansky <[email protected]> * typed categorical selection reducer (#417) Co-authored-by: atarashansky <[email protected]> * typed differential reducer (#419) Co-authored-by: atarashansky <[email protected]> * typed annoMatrix reducer (#416) Co-authored-by: atarashansky <[email protected]> * chore: purge autosave from codebase (#425) * chore: typed genesetsUI reducer * fix tsc error * chore: purge autosave * delete nameNewAnnotation * remove unused Co-authored-by: atarashansky <[email protected]> * chore: typed controls reducer (#418) * typed controls reducer * refine scatterplot accessor type to be string or false * address revisions * type level return function Co-authored-by: atarashansky <[email protected]> * typed point dilation (#421) Co-authored-by: atarashansky <[email protected]> * Revert "feat: add cellxgene schema 3.0.0 fields to Standard Categories (#412)" (#428) This reverts commit b265fcf. * typed graph selection reducer (#422) Co-authored-by: atarashansky <[email protected]> * chore: typed cascade reducer (#426) * test * update cascade reducer * add map as possible type for cascade * refactor(cascadeReducer): Quick feedback (#427) * revert changes * Update client/src/reducers/cascade.ts Co-authored-by: Severiano Badajoz <[email protected]> * remove as string * refactor(cascadeReducer): Quick feedback 2 (#430) Co-authored-by: atarashansky <[email protected]> Co-authored-by: Timmy Huang <[email protected]> Co-authored-by: Severiano Badajoz <[email protected]> * chore: typed genesetsUI reducer (#423) * chore: typed genesetsUI reducer * fix tsc error Co-authored-by: atarashansky <[email protected]> * chore: typed config reducer (#424) * chore: typed config reducer * restrict error type Co-authored-by: atarashansky <[email protected]> Co-authored-by: ashin-czi <[email protected]> Co-authored-by: atarashansky <[email protected]> Co-authored-by: atarashansky <[email protected]> Co-authored-by: Nayib Gloria <[email protected]> Co-authored-by: Timmy Huang <[email protected]> Co-authored-by: Severiano Badajoz <[email protected]> Co-authored-by: ashin-czi <[email protected]> Co-authored-by: atarashansky <[email protected]> Co-authored-by: atarashansky <[email protected]> Co-authored-by: Nayib Gloria <[email protected]> Co-authored-by: Timmy Huang <[email protected]> Co-authored-by: Severiano Badajoz <[email protected]>
This is probably the closest we could get to typing actions without using Redux Toolkit, which is their strongly recommended way to do Redux now.
The overall pattern is that each slice's reducer's
action
argument isAnyAction
, since any action goes through every reducer. But in the switch case, we cast the action to the slice's action type, since such action type should come with the agreed payload. Note that this is NOT guaranteed at runtime, because Explorer is NOT using action creators to allow TypeScript to map the action type and payload statically. But such refactor would take a lot more time, so this is a compromise for now until we see a strong need to start using Redux Toolkit