Hello,
It's not quite clear how to use samples.
For most of them, if I understood right, nodejs is needed.
I with to learn cujojs, ideally, without any other frameworks.
Here is example of using promisses from the tutorial:
function sayHello() {
var d = when.defer();
// 'setTimeout' in this example could be any operation
// like an XMLHttpRequest or an expected user input
setTimeout(function () {
d.resolve('hello');
}, 5000);
return d.promise;
}
sayHello().then(function (greeting) {
// five seconds later
console.log(greeting); // 'hello'
});
It's not quite clear how to include the "when". Usually I write something like:
<script src="somescript_where_when_is_defined.js"></script>
But it's not clear how to do it from the tutorial. For example, I supposed, that I need to reuse the "when.js" from the when.js.3.6.4.zip. I downloaded it. Extracted. But there are a lot of files inside. By comparison, if I use jquery, I just download archive, extract it, in the archive there is only one js file which can be included to a HTML page.
What to do here with cujo?
Probably there is something that I must read before using cojo. Could you please explain.