Skip to content

exiahuang/lwc-lodash

Repository files navigation

LWC Lodash

lwc-lodash is lodash for salesforce lwc developer. lodash

deploy lwc-lodash

Deploy to Salesforce

or

git clone https://github.com/exiahuang/lwc-lodash.git
cd lwc-lodash
sfdx force:source:deploy --loglevel fatal -p force-app/main/default/lwc/lodash/lodash.js-meta.xml --targetusername=$username_or_alias_for_your_sfdc_org

usage

create a lwc compnent

sfdx force:lightning:component:create --type lwc -n $lwc_name

import lwc-lodash to lwc code

import * as _ from 'c/lodash';

console.log(_.difference([1, 2, 3, 4, 5], [5, 2, 10]));

console.log(_.chunk(['a', 'b', 'c', 'd'], 2));

console.log(
_.reduce(
  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
  function (sum, n) {
    console.log("sum="+sum );
    console.log("n="+n);
    return sum + n;
  },
  0
));

console.log(_.concat([1], 2, [3], [[4]]));

console.log(_.includes([1, 2, 3], 1));

document

Releases

No releases published

Packages

No packages published