rewriting a plugin for zepto.js

2.3k views Asked by At

i'm trying to rewrite a little but awesome jquery plugin for zepto.js:

https://github.com/phiggins42/bloody-jquery-plugins/blob/master/pubsub.js

i don't think its a ploblem, because the syntax is nearly similar, but im struggling a little bit at this part of the pubsub plugin:

cache[topic] && d.each(cache[topic], function(){
    this.apply(d, args || []);
});

my console says something like:

TypeError: Result of expression 'd.each' [undefined] is not a function.

some hints how to get this working?

1

There are 1 answers

1
choise On BEST ANSWER

figured it out. .each didn't work with zepto.

here is my rewritten zepto plugin:

https://github.com/martinjuhasz/pubsub-zepto