반응형
SMALL

전체 글 130

[Firebase] Google Login 시, 강제로 구글유저 선택 창이 뜨게 하는 방법

구글로그인을 하기 위해서 서비스에 구글 로그인 버튼을 추가했습니다. async function handleLoginWithGoogle() { const provider = new GoogleAuthProvider() signInWithPopup(auth, provider) .then((result) => { const { user } = result; authStore.$patch({ auth: user, }); authUser.email = user.email as string; authUser.uid = user.uid; router.push(`/${DIARY}`); }) .catch((error) => { // Handle Errors here. const errorCode = error.code;..

기타 2022.06.20

[Netlify] SPA 배포 후 새로고침시 404로 나올 때 대처하는 방법

/public 폴더 안에 ‘_redirects’ 파일을 만듭니다(file extension 붙이지 않습니다.) 해당 파일에 다음과 같이 입력하고 다시 Netlify에 배포하면 이슈가 해소됩니다. /* /index.html 200 참고 https://docs.netlify.com/routing/redirects/ Redirects and rewrites Netlify builds, deploys, and hosts your frontend. Learn how to get started, find examples, and access documentation for the modern web platform. docs.netlify.com

기타 2022.06.19

타입을 집합으로 이해하기

never: 공집합 const x: never = 12; // Type 'number' is not assignable to type 'never'.(2322) unknown: 전체집합 리터럴타입: 원소가 1개인 집합 값이 T에 할당 가능: 값이 T의 원소 T1이 T2에 할당 가능: T1이 T2의 부분집합 T1이 T2를 상속: T1이 T2의 부분집합 T1 | T2: T1과 T2의 합집합 type A = 'A' type B = 'B'; type Twelve = 12; type AB = 'A' | 'B'; type AB12 = 'A' | 'B' | 12; const a: AB = 'A'; const c: AB = 'C' // Type '"C"' is not assignable to type 'AB'.(232..

TypeScript 2022.06.19

코드생성과 타입은 관계가 없음

타입스크립트 컴파일러 역할 최신 타입스크립트/자바스크립트를 브라우저에서 동작할 수 있도록 ⇒ 구버전의 자바스크립트로 트랜스파일 트랜스파일 = translate + compile 여전히 컴파일되야하는 코드이기 때문에 컴파일과 분리되어 용어가 설명됨 코드 타입 오류 체크 ⇒ 서로 완벽히 독립적 타입스크립트가 자바스크립트로 변환될 때 코드 타입에는 영향을 주지 않음 자바스크립트 실행시점에도 타입은 영향을 미치지 않음 런타임에는 타입체크가 불가능 instanceof 체크는 런타임에 일어나지만, Rectangle은 타입이라서 런타임에는 아무런 영향이 없음. 따라서 해당 오류가 발생 // 'Rectangle' only refers to a type, but is being used as a value here.(2..

TypeScript 2022.06.19

noImplicitAny, strictNullChecks의 선언

noImplicitAny function add(a, b) { return a + b } noImplicitAny가 해제돼있다면, 해당 코드의 타입은 다음과 같습니다. function add(a: any, b: any): any {} any타입을 매개변수에 사용하면 타입 체커는 유명무실해짐 따라서 noImplicitAny = true로해야함 그러면 위 코드는 다음과 같은 에러를 반환 // ‘a’ 매개변수에는 암시적으로 any 형식이 포함됩니다. 암시적으로 any로 설정됨 이는 해당 환경에서 오류로 간주 에러를 해결하려면 다음과 같이 하면됨 function add(a: number, b: number) { return a + b } // 혹은 function add(a: any, b: any) { retu..

TypeScript 2022.06.19

[IAM] 사용자, 그룹, 정책 - IAM 정책

version: 정책 언어 버전(언제나 2012-10-17) id: 정책 인식자(optional) statement: 1개 이상의 개별적인 statement(필수) Sid: statement의 인식자 Effect: statement가 allow 혹은 deny 접근인지 알려줌 Principal: 적용될 account/user/role Action: 이 정책이 allow 혹은 deny 된지에 관련된 액션 리스트 Resource: 액션이 적용된 리소스 리스트 Condition: 이 정책이 언제 적용될지에 관련된 조건

AWS 2022.06.19
반응형
LIST