Skip to content

Instantly share code, notes, and snippets.

@eduardo-matos
Created August 20, 2013 11:19
Show Gist options
  • Save eduardo-matos/6280193 to your computer and use it in GitHub Desktop.
Save eduardo-matos/6280193 to your computer and use it in GitHub Desktop.
Detecção de características da loja
define('loja', ['dojo/has'], function (has) {
var id = 123;
var pagina = 'departamento'
var depto = 'eletronicos'
has.add('loja-id-' + id, true);
has.add('loja-pagina-' + pagina, true);
has.add('loja-depto-' + depto, true);
return has;
});
require(['loja'], function (has) {
if(has('loja-id-456')) {
console.log('loja 456');
} else {
console.log('loja que não é 456');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment