-
Notifications
You must be signed in to change notification settings - Fork 39
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] Get rid of control variables #341
Conversation
✅ Deploy Preview for cheery-moxie-4f1121 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
tACK 98814ec
I didn't expect to like this too much, but it makes a lot of sense and is generally cleaner to maintain or debug.
One maintenance downside to potentially think about (JS issue again lol): on functions that return anything, this might remove the type-safety of JSDoc, as I don't think the type information will be preserved through lockableFunction
, thoughts?
Fortunately all current instances of lockableFunction
do not return anything, so this is only a future concern if we end up using it for anything with a return type.
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.
Add the parenthesis or the expect isn't run
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.
tACK
Abstract
Idea: Get rid of the control variables that we have in the code, like
#syncing
,#isFetchingLatestBlocks
,isCreatingTx
(maybe there are more?).This is done by creating a wrapper class
LockableFunction
that "simulates c++ RAII"