-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
react: implement exercise #787
Conversation
Note: no canonical data exists for this exercise. The test cases were ported from the C# track. |
exercises/react/README.md
Outdated
callbacks. Call a cell’s callbacks when the cell’s value in a new stable | ||
state has changed from the previous stable state. | ||
|
||
### Submitting Exercises |
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.
This should be at heading level 2.
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.
Done.
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.
There are a few things that definitely need changing, but I think I need a bit more time to truly understand the code (I haven't encountered reactive programming before). I'm a bit short of time at the moment, but I should be able to revisit this for a proper look at the weekend.
exercises/react/react.py
Outdated
def create_input_cell(value): | ||
pass | ||
|
||
def create_compute_cell(dependencies, updater): |
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.
Presumably these three methods should have self
as an argument?
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.
Yep. Thanks.
self.dependencies = dependencies | ||
self.dependents = set() | ||
self.updater = updater | ||
self.watchers = set() |
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.
If you're expecting this to exist (which line 80 of the tests implies), you need to either document it or supply it in the template code. I think you need to revisit this exercise and work out what methods/attributes the tests require to exist and add them to the template or document their expected behaviour. Currently, someone would have to delve into the test-suite to work out what methods should exist.
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.
My original intent was to hide that functionality behind methods add_watcher
and remove_watcher
; I'm not sure why I did away with this, but I've restored those methods. Reactor.watchers
is no longer needed by react_test.py
@N-Parsons I've address your comments, please review new changes after Travis-CI build has completed. Thanks. |
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.
Looks good.
* react: add README * react: update config.json * react: create solution template * react: write test cases * react: write example solution
* react: add README * react: update config.json * react: create solution template * react: write test cases * react: write example solution
Resolves #743
TODO:
config.json