lib/storeRedis.js
function( roomID, key ) {

		return this.getRoomIdForKey( key )
		.then( function( savedRoomId ) {

			if( savedRoomId == roomID ) {

				delete idToKey[ roomID ];
				delete keyToId[ key ];

				keys.push( key );

				return promise.resolve();
			} else {

				return promise.reject( 'roomID and roomID for key do not match' );
			}
		});
	}
function( roomID, key ) {

		return this.getRoomIdForKey( key )
		.then( function( savedRoomId ) {

			if( savedRoomId == roomID ) {

				delete idToKey[ roomID ];
				delete keyToId[ key ];

				keys.push( key );

				return promise.resolve();
			} else {

				return promise.reject( 'roomID and roomID for key do not match' );
			}
		});
	}
function ( roomID , key ) { return this . getRoomIdForKey ( key ) . then ( function ( savedRoomId ) { if ( savedRoomId == roomID ) { delete idToKey [ roomID ] ; delete keyToId [ key ] ; keys . push ( key ) ; return promise . resolve ( ) ; } else { return promise . reject ( 'roomID and roomID for key do not match' ) ; } } ) ; }
return a room key so someone else can use it.

@param  {String} roomID id of the room you'll be returning a key for
@param  {String} key the key you'd like to return
@return {Promise} This promise will succeed when the room key was returned
return a room key so someone else can use it .