Nikita Chursin 87bcda1f8e added installation info to readme | 3 年 前 | |
---|---|---|
.husky | 3 年 前 | |
.vscode | 3 年 前 | |
config | 3 年 前 | |
force-app | 3 年 前 | |
.eslintignore | 3 年 前 | |
.forceignore | 3 年 前 | |
.gitignore | 3 年 前 | |
.prettierignore | 3 年 前 | |
.prettierrc | 3 年 前 | |
README.md | 3 年 前 | |
jest.config.js | 3 年 前 | |
package-lock.json | 3 年 前 | |
package.json | 3 年 前 | |
sfdx-project.json | 3 年 前 |
This is a small package that tends to replicate LWC backend APIs that don't support promises.
That is probably the main question you may have if you stumbled across this repo. The main reason is I don't like the @wire
decorator:
isLoading
getter becomes messy.wire
cuase some of our e2e tests go flaky. Probably we just don't know how to cook it here though.getRecord
cannot be promisified. At least I didn't found how to do it :(This is distributed as an unlocked package. Just install the latest version.
Alternatively, you can clone this repo and push/deploy it to your org.
Instead of importing getRecord
from LWC library, you can just use getRecord
from sfcraft_LwcApi
:
import getRecord from '@salesforce/apex/sfcraft_LwcApi.getRecord';
...
async connectedCallback () {
this.record = await getRecord({recordId: this.recordId, fields: ['Id', 'Name' ]});
}