Skip to content

Commit

Permalink
feat: allow .s to accept an object
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Mar 24, 2018
1 parent 0cf82da commit aedbc41
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion addon/snake.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ exports.addon = function (renderer, rules) {

var defaultRules = renderer.assign({}, atoms, {
s: function (prop, value) {
this[prop] = (value instanceof Object) ? (value.obj || value) : value;
if (prop instanceof Object) {
for (var name in prop) {
defaultRules.s.call(this, name, prop[name]);
}
} else {
this[prop] = (value instanceof Object) ? (value.obj || value) : value;
}
},

hover: function (value) {
Expand Down

0 comments on commit aedbc41

Please sign in to comment.