How to use dojo dictionary object and dojo.mixin() function? -
i have function need override it.
myfunction.getextraconfig=function() { return {}; };
i need pass in object , have return multiple values.
how use dictionary {prop1: 1, prop2: 3}?
how use dojo.mixin() add return value?
is there sample code can refer to?
dojo's mixin function mixes objects' properties. return value in getextraconfig function not object property.
i'm not sure want, 1 way alter return value getextraconfig use dojo/aspect:
define(["dojo/_base/lang", "dojo/aspect"], function(lang, aspect){ //... aspect.after(myfunction, "getextraconfig", function(original){ return lang.mixin(original, {prop1: 1, prop2: 3}); }); //... });
Comments
Post a Comment