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

Small improvements in the quiescent todomvc example #2

Open
wants to merge 5 commits into
base: gh-pages
Choose a base branch
from

Conversation

janherich
Copy link

Hi Luke,

With this pull request, i did some improvements to your todomvc quiescent sample, i divided it into 3 commits, each one implementing one change.

There is still some work to do, for example 'toggle all' functionality is not working at the moment, i will try to fix that too.

janherich added 5 commits July 2, 2014 20:13
I believe the correct TodoMVC behavior is to hide footer if there are
no items present in todo-list.
This commits implements todo items hiding according to filter state
in a more (i believe) idiomatic way.

Instead of relying on css class to show/hide particular DOM element,
when we specify parent component (TodoList) we first filter through
app items and call child component (Item) only when it's not hidden
according to our display logic (determined by hidden? function).

It has a nice side-effect that we don't have to pass [item filter]
tuple to Item component as just item us sufficient and also fixes
the bug that whenever our filter state was set to 'complete' and we
added new todo item, this item was shown in the list even when it
should really be hidden in my opinion.
I believe that put! calls are more idiomatic way to put value on
core.async channel from callback as we are not interested in
establishing state machine created by go macro, it's basically ->

'put the value on channel and i am not interested in rendezvous
wit the consumer, there is no need for coordination, thanks'

I hope my understanding of core.async is correct though, so please
review carefully :)
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.

1 participant