This file contains hidden or 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
import { LightningElement, wire } from 'lwc'; | |
import { CurrentPageReference } from 'lightning/navigation'; | |
export default class PageRefDemo extends LightningElement { | |
@wire(CurrentPageReference) | |
currentPageReference; | |
handleDisplayPageRefObj(){ | |
const pageRefObj = JSON.stringify(this.currentPageReference, null, 4); |
This file contains hidden or 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
import checkPermission from '@salesforce/apex/PermissionService.checkPermission'; // https://github.com/tsalb/lwc-utils | |
const hasPermission = async (apiName) => { | |
const response = await checkPermission({ apiName: apiName }); | |
return response; | |
} | |
// Straight from component library playground | |
const fetchFakeDataHelper = async ({ amountOfRecords }) => { | |
const recordMetadata = { |
This file contains hidden or 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
"use strict"; | |
/* A version number is useful when updating the worker logic, | |
allowing you to remove outdated cache entries during the update. | |
*/ | |
var version = 'v1::'; | |
/* These resources will be downloaded and cached by the service worker | |
during the installation process. If any resource fails to be downloaded, | |
then the service worker won't be installed either. |
This file contains hidden or 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
// delete all the local branches except master branch | |
git branch | grep -v "master" | xargs git branch -D |
This file contains hidden or 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
git fetch origin | |
git checkout feature/example-branch | |
git reset --hard origin/feature/example-branch | |
-- | |
git fetch origin | |
git checkout master | |
git reset --hard origin/master |
This file contains hidden or 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
const isDev = process.env.NODE_ENV === 'development' | |
module.exports = { | |
mode: isDev ? 'development' : 'production', | |
entry: [ | |
'@babel/polyfill', // enables async-await | |
'./client/index.js' | |
], | |
output: { | |
path: __dirname, |
This file contains hidden or 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
{{checkType (prod)}} | |
Handlebars.registerHelper('checkType', (val) => { | |
console.log(val, '-->', typeof val) | |
} | |
// false --> boolean | |
// true --> boolean |
This file contains hidden or 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
Handlebars.registerHelper('outer-helper', (result, greeting) => { | |
return `${result} ${greeting}` | |
}) | |
Handlebars.registerHelper('inner-helper', (name) => { | |
return `Hello, ${name}.` | |
}) |