src/index.js
function deregisterWish(wish) {
  let indexOfWish = _wishes.indexOf(wish)
  if (!indexOfWish) {
    _each(_wishes, (aWish, index) => {
      // the given parameter could be an id.
      if (wish === aWish.id || wish.id === aWish.id) {
        indexOfWish = index
        wish = aWish
        return false
      }
    })
  }

  _wishes.splice(indexOfWish, 1)
  _removeWishIdFromEnteredMagicWords(wish.id)
  return wish
}
function deregisterWish(wish) {
  let indexOfWish = _wishes.indexOf(wish)
  if (!indexOfWish) {
    _each(_wishes, (aWish, index) => {
      // the given parameter could be an id.
      if (wish === aWish.id || wish.id === aWish.id) {
        indexOfWish = index
        wish = aWish
        return false
      }
    })
  }

  _wishes.splice(indexOfWish, 1)
  _removeWishIdFromEnteredMagicWords(wish.id)
  return wish
}
function deregisterWish ( wish ) { let indexOfWish = _wishes . indexOf ( wish ) if ( ! indexOfWish ) { _each ( _wishes , ( aWish , index ) => { // the given parameter could be an id. if ( wish === aWish . id || wish . id === aWish . id ) { indexOfWish = index wish = aWish return false } } ) } _wishes . splice ( indexOfWish , 1 ) _removeWishIdFromEnteredMagicWords ( wish . id ) return wish }
Deregisters the given wish. Removes it from the registry
and from the _enteredMagicWords map.
This will delete an _enteredMagicWords listing if this
is the only wish in the list.
@param {object|string} wish The wish to deregister
@returns {wish} The deregistered wish
@public
Deregisters the given wish . Removes it from the registry and from the _enteredMagicWords map . This will delete an _enteredMagicWords listing if this is the only wish in the list .