ljharb on master
[eslint config] [base] [patch] … [eslint config] [patch] extend … Merge pull request #1996 from r… (compare)
ljharb on master
[editorial] [react] fix typo [eslint config] [*] [deps] upda… (compare)
React
portion of the guide to be updated further? Given the way it refers to function components as stateless
and only recommending them if you don't have state or refs, I feel like it hasn't been updated to reflect the introduction of hooks
Hi there
I have an async function which I would like to convert to an Observable stream (using rxjs operators). The await
calls must execute in the order they appear in the function.
async authenticateUser(profile: Profile): Promise<any> {
let authCookie: any;
try {
authCookie = await getCookie();
} catch (error) {
console.error(error);
}
if (!authCookie || authCookie?.length < 1) {
cancelAuthenticationCookieGet();
throw {message: "login failed", status: -2};
}
await saveProfileAsync(profile);
await storeCurrentAuthCookieAsync(authCookie);
storeSessionStorage();
await setPartitionSessionCookie(profile.url, authCookie);
}
Is there a clean way to accomplish the above?
description is :
Enzyme is a JavaScript Testing utility for React that makes it easier to test your React Components' output. You can also manipulate, traverse, and in some ways simulate runtime given the output.
jest
yarn create react-app ...
and by default I got setupTests.js
file with import '@testing-library/jest-dom/extend-expect';
@testing-library...
packages
setupTests.js
file according to the enzyme
test runner instead of default @testing-library...
@helper
)? For example, a form to let user write setting for servers, we don' t know how many settings they will make so we use a Form(serversetting:List[ServerSetting]) serversetting->list(mapping(id->number,purpose->Text)(ServerSetting.apply)(ServerSetting.unapply))
data structure. In this case, what is the best way to write the html code?