Skip to content
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

Merged
merged 12 commits into from
Nov 5, 2017
Merged

Conversation

cmccandless
Copy link
Contributor

@cmccandless cmccandless commented Oct 9, 2017

Resolves #743

TODO:

  • add README
  • update config.json
  • create solution template
  • write test cases
  • write example solution

@cmccandless
Copy link
Contributor Author

Note: no canonical data exists for this exercise. The test cases were ported from the C# track.

@cmccandless cmccandless changed the title (WIP) react: implement exercise react: implement exercise Oct 15, 2017
@cmccandless cmccandless requested review from N-Parsons and removed request for behrtam October 30, 2017 17:06
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
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor

@N-Parsons N-Parsons left a 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.

def create_input_cell(value):
pass

def create_compute_cell(dependencies, updater):
Copy link
Contributor

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?

Copy link
Contributor Author

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()
Copy link
Contributor

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.

Copy link
Contributor Author

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

@cmccandless
Copy link
Contributor Author

@N-Parsons I've address your comments, please review new changes after Travis-CI build has completed. Thanks.

Copy link
Contributor

@N-Parsons N-Parsons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@N-Parsons N-Parsons merged commit 549e1b3 into exercism:master Nov 5, 2017
@cmccandless cmccandless deleted the implement-react branch November 6, 2017 17:33
smalley pushed a commit to smalley/python that referenced this pull request Nov 12, 2017
* react: add README

* react: update config.json

* react: create solution template

* react: write test cases

* react: write example solution
smalley pushed a commit to smalley/python that referenced this pull request Nov 12, 2017
* react: add README

* react: update config.json

* react: create solution template

* react: write test cases

* react: write example solution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants