Closed MattiasBuelens closed 10 years ago
Ahhh that’s too bad we removed the _State.setState.state
functions, I was going to split up the setState
method like this :stuck_out_tongue_closed_eyes:
setStates: function(state, els) {
return Array.prototype.map.call(els, this.setState[state]);
},
I don't really like adding properties to a function, i.e. setState.checked
. Although I agree that perhaps the handling of arrays can be moved outside of setState
and let setState
only deal with a single ID or element as input.
How about d10aa37? Would be nicer without that silly for loop :stuck_out_tongue:
Sure, that works too.
Turns out we don't even need the currying for the
map
parameter, we can just pass thestate.checked
andstate.indeterminate
arrays as argument. :stuck_out_tongue: I just removed the curry helper altogether.Made
rotateState(s)
accept the DOM element as parameter. This puts it in line with thesetState
signature and makes it easier to work with.