Skip to content

Instantly share code, notes, and snippets.

@arun12209
Created June 12, 2022 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arun12209/7be22c511342f1d2360d613d3ff3869e to your computer and use it in GitHub Desktop.
Save arun12209/7be22c511342f1d2360d613d3ff3869e to your computer and use it in GitHub Desktop.
import { LightningElement } from 'lwc';
//import the helper javascript module/file
import fetchDataHelper from './fetchDataHelper';
const columns = [
{ label: 'Label', fieldName: 'name' },
{ label: 'Website', fieldName: 'website', type: 'url' },
{ label: 'Phone', fieldName: 'phone', type: 'phone' },
{ label: 'Balance', fieldName: 'amount', type: 'currency' },
{ label: 'CloseAt', fieldName: 'closeAt', type: 'date' },
];
export default class LightningTable extends LightningElement {
data = [];
columns = columns;
// async-await method
async connectedCallback() {
const data = await fetchDataHelper({ amountOfRecords: 100 });
this.data = data;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment