From fdbec37d1ced6799b4301e1682e5b35ab0775a50 Mon Sep 17 00:00:00 2001 From: mikezimm <49648086+mikezimm@users.noreply.github.com> Date: Wed, 28 Sep 2022 01:02:01 -0400 Subject: [PATCH] add await to super.onInit() in sample I was getting floating promise warning when calling super.onInit() without an await; Added await and the warning went away. ```console [00:46:34] Warning - lint - src\webparts\listAPalooza\ListAPaloozaWebPart.ts(44,5): error @typescript-eslint/no-floating-promises: Promises mu [00:46:34] Warning - lint - src\webparts\listAPalooza\pnpjsConfig.ts(15,15): error eqeqeq: Expected '!==' and instead saw '!='. ``` --- .../src/webparts/pnPjsExample/PnPjsExampleWebPart.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/react-pnp-js-sample/src/webparts/pnPjsExample/PnPjsExampleWebPart.ts b/samples/react-pnp-js-sample/src/webparts/pnPjsExample/PnPjsExampleWebPart.ts index c7221ec77..336da31ea 100644 --- a/samples/react-pnp-js-sample/src/webparts/pnPjsExample/PnPjsExampleWebPart.ts +++ b/samples/react-pnp-js-sample/src/webparts/pnPjsExample/PnPjsExampleWebPart.ts @@ -26,7 +26,7 @@ export default class PnPjsExampleWebPart extends BaseClientSideWebPart { this._environmentMessage = this._getEnvironmentMessage(); - super.onInit(); + await super.onInit(); //Initialize our _sp object that we can then use in other packages without having to pass around the context. // Check out pnpjsConfig.ts for an example of a project setup file.