This file contains 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
class Storage { | |
get(item) { | |
const request = new Promise((resolve, reject) => { | |
let data = localStorage.getItem(item); | |
console.log(`Start of promise`); | |
(data) ? resolve(data) : reject(); | |
}); | |
request.then((data) => { | |
console.log(`promise resolved`); |
This file contains 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
/** | |
* Laravel's Arr::dot function for Javascript. | |
* IMPORTANT: Requires lodash installed. | |
*/ | |
function dot(array, prepend) { | |
results = [] | |
prepend = prepend || '' | |
$.each(array, function(key, value) { | |
if ((_.isObject(value) || _.isArray(value)) && ! _.isEmpty(value)) { |
OlderNewer