Comments (3)
I disagree, I think whether or how the delete buttons appear is a view concern.
from todomvc.net.
I was torn when I did the initial implementation and I felt the same as you. However, after some more thought I'm sure it's wrong as it is. At the moment there's a bit of business logic that we can't test because it's in the view.
I think it might be best to create a component for the to-do item. Then dispatching an action to control the button behaviour seems right. I need to look into how components interact with the store though.
Sent from my Google Nexus 6 using FastHub
from todomvc.net.
Ah, but you can test it; using test stack.white or something similar. Anyway, while i'm for giving the business logic as much test coverage as possible, i'm not sure if visual effects in the view count as business logic... Put it this way, the idea behind separation of view and business logic is that ideally we develop the business logic seperately, and some UX expert goes away and develops the UI, complete with whatever fancy visual effects they want. If we start dragging the logic of visual elements like that into the viewmodel, (or the data store / reducer) then we are essentially prescribing fine details of the view and getting in the way of the UX designers job.
Granted there is a line to be drawn at where this ends, obviously we need to prescribe some elements, and I don't have a clear rule in mind for where we draw the view / business logic distinction, but I think there has to be one.
Lets discuss this tomorrow, it's time for game of thrones.
from todomvc.net.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from todomvc.net.