JSFiddle - React, Tailwind, and code Playground

by jakelauer

JavaScript

const addDeleteColumns = () => {
	console.log("Do stuff here");
  throw new Error("This gets caught and sent via reject()")
}

const onColumnsUpdated = (columns) => {
	return new Promise((resolve, reject) => {
  	try{
    	const updatedColumns = [addDeleteColumns()]; // do your thing here
      resolve(updatedColumns);
    }
    catch(e){
    	reject(e);
    }
  })
}