Created
April 19, 2018 10:51
-
-
Save Tinusw/82f436dee2401263607611ec028f2cce 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
export function storageMock() { | |
var storage = {}; | |
return { | |
setItem: function(key, value) { | |
storage[key] = value || ""; | |
}, | |
getItem: function(key) { | |
return key in storage ? storage[key] : null; | |
}, | |
removeItem: function(key) { | |
delete storage[key]; | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment