-
Notifications
You must be signed in to change notification settings - Fork 174
Organise utilities #59
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
Conversation
| } | ||
| } | ||
|
|
||
| const controlButton = ( |
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.
Nice, can this be applied to Editor as well? I think it still uses genericButton
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.
Sounds good (and DRY), but how do you wanna go about it?
- Change
Editorto have the same functioncontrolButton - .Export
controlButtonfrom here and import it intoEditor - Abstract
controlButtoninto a separate file withinworkspace - Abstract
controlButtoninto a new/existing file underutils
I'm leaning towards (2) tbh
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.
Since controlButton does not originate from here, I think abstracting into the utils folder is better. If there was something that belongs to ReplControl, it would make more sense to export.
- utils is a new directory under ./src/ holding misc modules that don't seem to fit anywhere else. - createStore was excluded from utils since the store is a core part of our react/redux app, and so it does make sense as a standalone module in the root ./src/ directory - Also fixed #37 unnecessary yield undefined.
Also avoided variable name negation by renaming its argument 'notMinimal' -> 'minimal'. Refactor ReplControl to list declarations in decreasing levels of abstraction. (addresses review in PR #35)
- Add a mockTypeError in mocks for situations that require a mock SourceError of some kind.
Also fixed typescript type errors on yarn start.
Features
notification.tsandregisterServiceWorker.tsinto their own utility directorygenericButton->controlButtonaccording to PR Add Source §2 #35yield undefinedaccording to issue Follow Up on Review of PR35 #37ReplControl.tsxto list declarations in decreasing levels of abstractionRepl.tsxfrom 67% to 100%Issues fixed