Created
May 10, 2021 00:50
-
-
Save iskenxan/d303ff62a83ec548e76ebc6c7185d3fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
processInventory = (widget) => { | |
displayLoader(); | |
switch (this.action) { | |
case "REQUEST": { | |
const { first, inventoryItems } = this.requestInventory( | |
this.inventoryItems | |
); | |
this.inventoryItems = inventoryItems; | |
return first; | |
} | |
case "CLEAR": { | |
return this.clearInventory(); | |
} | |
case "ADD": { | |
return this.addToInventory(widget); | |
} | |
case "DELETE": { | |
return this.deleteFromInventory(widget); | |
} | |
default: | |
break; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment