[Dojo-interest] Returning value from 1.7 require

niels harremoes nielsull at gmail.com
Mon May 14 04:31:11 EDT 2012


I am trying to return a value from a method, which uses some dojo libraries,
whihc are loaded on demand using require:

A simple example using dojo.query:

function findRelevantElements()
	var result = null;
	require(['dojo/query'], function(query) {
		result = query(".relevant");
	return result;

This seems quite clunky, updating the result variable in the external
closure from the internal function. Is there a simpler way?

View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Returning-value-from-1-7-require-tp3985197.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.

More information about the Dojo-interest mailing list