How to use the undef function from requirejs

Find comprehensive JavaScript requirejs.undef code examples handpicked from public code repositorys.

35
36
37
38
39
40
41
42
43
44
logger.verbose('Unloading cached copies of server.js files in ' + coursePath + ' ...');
var count = 0;
async.each(_.keys(requirejs.s.contexts._.defined), function(modPath, callback) {
    if (_.startsWith(modPath, coursePath)) {
        count++;
        requirejs.undef(modPath);
    }
    callback(null);
}, function(err) {
    if (ERR(err, callback)) return;
fork icon256
star icon0
watch icon1

87
88
89
90
91
92
93
94
95
96
if(state === 1 && count === 1) { // not sure why this is called twice sometimes (for this it seems to be every time, but other builds it only happens once)
    requirejs([filePath], function(amd) {
        t.eq(amd.x, 2)
    })
} else if(state === 2) {
    requirejs.undef(filePath)
    requirejs([filePath], function(amd) {
        t.eq(amd.x, 3)
        emitter.close() // close the watcher
    })
fork icon0
star icon2
watch icon3