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

Architecture: use zipper!?! #20

Open
paulkoegel opened this issue Sep 2, 2014 · 0 comments
Open

Architecture: use zipper!?! #20

paulkoegel opened this issue Sep 2, 2014 · 0 comments

Comments

@paulkoegel
Copy link
Owner

Problem: in an onClick callback, we need to decide whether a card is moveable - this depends on its children.
A card is not moveable, when one of its children is out of order.
A card is moveable when it has no children or all of them are in order.
Example: [jack-of-spades, 2-of-diamonds] - the 2 of diamonds i moveable b/c it's the last card in the column, the jack of spades, however, is not moveable. It would be moveable if a 10 of diamonds was its only child.

Idea: use a zipper as the app state (cf. https://groups.google.com/forum/#!topic/clojurescript/RY5kEfSTc6k), so we can easily traverse from a clicked card to its children with the help of zipper functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant