Skip to content
  • home
  • portfolio
  • web design journal
  • blog
    • adventure
    • san diego
    • projects
    • website design
Blog Web Dev Getting Data from Multiple .then Statements in Javascript

Getting Data from Multiple .then Statements in Javascript

By Forrest Smith - Drempd.com

I always have a hard time pulling data through multiple .then statements in javascript. This method works sufficiently well. Basically, define an array/object, and then as data is collected, add content to that array. All of the collected content should be available in the final .then statement. Something like this (all the data is collected into the viewData variable):

data = {};
data['table'] = 'tableName';

var viewData = {};
viewData['table'] = data;

get_table_columns(data['table'])
.then(function(columnData){
viewData['columns'] = columnData;
})
.then(get_row_data)
.then(function(rowData){
viewData['values'] = rowData;
console.log(viewData);
});

Posted on September 18, 2023September 18, 2023 in Web Dev
  • Adventure

    • adventure
    • gravelgrinding
    • hiking
    • running
  • The Built Environment

    • architecture
    • urbanity
  • Locations

    • san diego
    • portland
  • Freelance Life

    • freelancing
    • productivity
  • Web Dev

    • css
    • entrepreneurship
    • git
    • handlebars
    • html
    • inkscape
    • photoshop
    • php
    • sass
    • web design
    • web development
    • saphire

drempd | san diego, ca


home contact

adventures san diego urbanity and architecture projects stream website design

portfolio resume san diego web design freelance web designer

custom web design responsive web design website maintenance