api/index.js
// removeDeck: take in a single id argument then remove the deck object from the list and return the id of the deleted deck.
take in a single id argument then remove the deck object from the list and return the id of the deleted deck.
take in a single id argument then remove the deck object from the list and return the id of the deleted deck .
function removeDeck(id) {
    return AsyncStorage.getItem(DECKS_STORAGE_KEY)
        .then(results => {
            const decks = JSON.parse(results);
            decks[id] = undefined;
            delete decks[id];
            return AsyncStorage.setItem(DECKS_STORAGE_KEY, JSON.stringify(decks))
                .then(() => id);
        })
}
function removeDeck ( id ) { return AsyncStorage . getItem ( DECKS_STORAGE_KEY ) . then ( results => { const decks = JSON . parse ( results ) ; decks [ id ] = undefined ; delete decks [ id ] ; return AsyncStorage . setItem ( DECKS_STORAGE_KEY , JSON . stringify ( decks ) ) . then ( ( ) => id ) ; } ) }
removeDeck: take in a single id argument then remove the deck object from the list and return the id of the deleted deck.
removeDeck : take in a single id argument then remove the deck object from the list and return the id of the deleted deck .