lib/creatures_application.js
function done(err) {

			that._gcw = 'done_get_creatures';

			bomb.defuse();

			// Unsee the 'getting_creatures' event
			that.unsee('getting_creatures');

			// Call next on the next tick (in case we call back with an error)
			Blast.nextTick(next);

			if (err) {
				that.log('error', 'Error getting creatures: ' + err)
				callback(err);
			} else {

				let result = [];

				for (let id in that.creatures_by_id) {
					if (that.creatures_by_id[id]) {
						result.push(that.creatures_by_id[id]);
					}
				}

				callback(null, result);
				that.emit('_got_creatures', err, result);
			}
		}
function done(err) {

			that._gcw = 'done_get_creatures';

			bomb.defuse();

			// Unsee the 'getting_creatures' event
			that.unsee('getting_creatures');

			// Call next on the next tick (in case we call back with an error)
			Blast.nextTick(next);

			if (err) {
				that.log('error', 'Error getting creatures: ' + err)
				callback(err);
			} else {

				let result = [];

				for (let id in that.creatures_by_id) {
					if (that.creatures_by_id[id]) {
						result.push(that.creatures_by_id[id]);
					}
				}

				callback(null, result);
				that.emit('_got_creatures', err, result);
			}
		}
function done ( err ) { that . _gcw = 'done_get_creatures' ; bomb . defuse ( ) ; // Unsee the 'getting_creatures' event that . unsee ( 'getting_creatures' ) ; // Call next on the next tick (in case we call back with an error) Blast . nextTick ( next ) ; if ( err ) { that . log ( 'error' , 'Error getting creatures: ' + err ) callback ( err ) ; } else { let result = [ ] ; for ( let id in that . creatures_by_id ) { if ( that . creatures_by_id [ id ] ) { result . push ( that . creatures_by_id [ id ] ) ; } } callback ( null , result ) ; that . emit ( '_got_creatures' , err , result ) ; } }
Function that'll call next on the queue & the callback
Function that ll call next on the queue & the callback