-
Notifications
You must be signed in to change notification settings - Fork 170
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
Organise utilities #59
Conversation
</div> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
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
Editor
to have the same functioncontrolButton
- .Export
controlButton
from here and import it intoEditor
- Abstract
controlButton
into a separate file withinworkspace
- Abstract
controlButton
into 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.ts
andregisterServiceWorker.ts
into their own utility directorygenericButton
->controlButton
according to PR Add Source §2 #35yield undefined
according to issue Follow Up on Review of PR35 #37ReplControl.tsx
to list declarations in decreasing levels of abstractionRepl.tsx
from 67% to 100%Issues fixed