Step One: Watch Writing Testable JavaScript - Rebecca Murphey from Full Frontal 2012 (award for worst conference name ever?)
Step Two: Fork this gist.
Step Three: Consider the four responsibilities that Rebecca lists for client side code (hint: they're color coded).
- Did any of the responsibilities that she lists surprise you?
presentation & interaction data/server communication application state setup
I wouldn't say that I was surprised like. OMG WHAAAA?
I would say that I was mostly aware of the most of the concepts. I wouldnt be able to list them out. I would say I understood that is usually consumed or passed as data from some sort of server interaction. Next, I would say that presentation and interaction is pretty much obvious since it is the very purpose of client side code IMO. Next, I think that state is something I am new to, but starting to understand ever since writing some react code. Lastly, Setup seems to be a bit weird, I dont really know how to explain it.
- Do you feel like you mentally split your client side code in IdeaBox and other past projects into these responsibilities?
Yea, I think so! My code had obvious file seperation that mimic-ed SRP. This was mainly devided between behavior(fns), things(obj), and actions(events/listeners).
Step Four: Totally Optional: take a look at some of the other forks and comment if the spirit moves you.
👍