exports.query = (sql, props) => {
return new Promise((resolve, reject) => {
pool.getConnection((err, connection) => {
if (err) throw err;
connection.query(
sql, props,
(err, res) => {
if (err) reject(err);
else resolve(res);
}
);
connection.release();
});
});
};
<div class="input_block"><input type="text" class="istyle"></div>
<div class="info"><span>Информация</span></div>
.input_block, .info { display: inline-block; float: right; transition: all 0.2s ease; }
.info { width: 100px; height: 100px; }
.istyle { width: 100px; height: 20px; }
.istyle:focus { width: 200px; transition: all 0.2s ease; }
addToItems(id) {
let items = this.items;
items.forEach(item => {
if(item.id == id) {
this.selectedItems[id] = item;
return;
}
});
}
selectedData() {
let items = this.selectedItems;
let itemsLength = Object.keys(items).length;
if(itemsLength < 8) {
for(let i = 1; i <= (8 - itemsLength); i++) {
items[-i] = {};
}
}
return items;
}
(accessToken, refreshToken, params, profile, done) => {
// {работаем с базой данных}
let dda = params.token;
done(null, dda);
}
(function checkPrice(i){
if(i >= items.length) {
return;
}
setTimeout(function(){
console.log(items[i]);
checkPrice(i + 1);
}, 1000);
})(0);