webos - enyo mixin: Is this proper usage? -


i have following code, looks following:

var shared = {     create: function(){         //do stuff on create     } }  enyo.kind(enyo.mixin({     name: "custominput",     //properties unique input.     kind: enyo.input },shared));  enyo.kind(enyo.mixin({     name: "customtextarea",     //properties unique input.     kind: enyo.textarea },shared));  enyo.kind(enyo.mixin({     name: "customselect",     //properties unique input.     kind: enyo.select },shared)); 

i'm being informed peers incorrect way of doing things, , potentionally break something, or confusing because they've never seen mixins used in way.

my question is, there wrong doing this, in way?

if extending kinds mixins, here newer way this:

enyo.createmixin({     name: 'mymixin',     mymethod: function() {         // stuff     } });  enyo.control.extend({      mixins: ['mymixin'] }); 

this mix in before instantiation. if wish add properties @ run time, use mixin() funciton.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -