본문 바로가기

2022/04

(18)
XState와 비동기 1편: useEffect 안의 비동기 코드는 위험합니다! 원문 보기 Async Code in useEffect is Dangerous. How Do We Deal with It? - This Dot Labs The introduction of async/await to Javascript has made it easy to express complex workflows that string together multiple asynchronous tasks. Let's take a look… www.thisdot.co Javascript에 async/await가 도입되면서 여러 비동기 작업을 함께 묶는 복잡한 워크플로를 쉽게 표현할 수 있습니다. const useClient = (user) => { const [client, setClient] = useStat..
XState : 상태 머신과 상태차트 소개 공식 문서를 번역한 내용입니다. Introduction to state machines and statecharts | XState Docs Introduction to state machines and statecharts Statecharts are a visual language used to describe the states in a process. You may have used similar diagrams in the past to design user flows, plan databases or map app architecture. Statecharts are another xstate.js.org 상태 차트는 프로세스의 상태를 설명하는 데 사용되는 시각적 언어입니다. 과거에 유사한 다..
[TypeOrm]ORM을 프로젝트에 도입할 때 주의할점 ORM에 대한 찬반양론 JPA와 TypeORM이 꽤 많이 쓰이는 것으로 인식되고 있지만, ORM의 효용성 여부는 아직까지도 실무자들 사이에 큰 논란이 되고 있다. https://martinfowler.com/bliki/OrmHate.html bliki: OrmHate Object-Relational Mappers get a lot of hate from people who misjudge the complexities of the task. martinfowler.com https://www.reddit.com/r/golang/comments/t08oox/are_orms_considered_an_antipattern_in_go/ ORM은 매우 구체적 사항이 누출된 추상화입니다. 사소하지 않은 일에 대해서..
XState : 액터 모델 간단히 알아보기 공식 문서 Actors | XState Docs Actors 4.6+ 🚀 Quick Reference The Actor model (opens new window) is a mathematical model of message-based computation that simplifies how multiple "entities" (or "actors") communicate with each other. Actors communicate by sending messages (events) to e xstate.js.org 프로그래머로서 어떤 기술을 처음 배울 때에는 명세보다는 역할, 즉 용례 위주로 접근하는 것이 좋다. Actor 모델은 Akka(Scala), Elrang에서 동시성 문제를 해결하기 위해..
타입스크립트 : 탬플릿 리터럴 타입으로 타입 안전하게 코딩하기 https://toss.tech/article/template-literal-types Template Literal Types로 타입 안전하게 코딩하기 TypeScript 코드베이스의 타입 안전성을 한 단계 올려줄 수 있는 Template Literal Type의 뜻과 응용에 대해 알아봅니다. toss.tech 탬플릿 리터럴 타입은 Parser 개발에 매우 효과적이다. 해당 글 말미에 소개된 예제들의 타입 구현을 따라가본다. 기본적으로 모두 재귀와 타입 추론(infer), 공변과 반공변을 적절히 사용하여, 해당 구현들을 공부해두면 다른 구현들을 이해하는데 큰 도움이 될 것이다. 예제 1 : Express route parameter에서 파라미터 추출하기 (난이도 하) type C = ExtractRou..
React와 Typescript를 함께 사용하기 : 유용한 유틸리티 타입 원문 보기 Typescript: Five most useful utility types for React Let's explore TypeScript utility types for React. Utility types are a powerful feature for constructing new types. isamatov.com 이 포스트에서는 React 애플리케이션에서 실용적인 5가지 TypeScript 유틸리티 타입을 다룰 것입니다. keyof 엄밀히 말하면 keyof는 유틸리티 타입이 아닌 연산자이지만 비슷한 방식으로 사용됩니다. keyof는 전달한 타입의 속성 이름으로 구성된 유니온 타입을 만듭니다. keyof는 객체의 기존 키를 사용하여 적용하는 데 적합합니다. Partial Partial은..
React와 Typescript를 함께 사용하기 : 간단한 6개의 팁 원문 보기 6 simple tips for working with React and TypeScript Common tips, suggestions, and techniques useful when building React applications with TypeScript. isamatov.com TypeScript로 React 애플리케이션을 구축할 때 유용한 몇 가지 일반적인 팁, 제안 및 기술을 다룰 것입니다. Use utility types (유틸리티 타입) TypeScript로 작업할 때 기존 타입 위에 새 타입을 생성하려는 경우가 많습니다. 이 방법으로 새 ​​타입을 만들면 몇 가지 이점이 있습니다. DRY 원칙과의 일관성 유지. 기존 타입을 재사용하여 코드의 반복을 줄입니다. 타입을 동기화..
타입스크립트 : 모듈 확장(module augmentation)으로 서드파티 관련 타입 문제 해결하기 원문 보기 Solve any external library error in TypeScript with module augmentation When you get stuck, use module augmentation to tweak the modules that you can't access otherwise. isamatov.com 이 TypeScript 튜토리얼은 모듈 확장을 사용하여 외부 라이브러리로 작업할 때 발생할 수 있는 타입 오류를 해결하는 방법을 다룹니다. 모듈 확장을 사용하여 다른 방법으로는 액세스할 수 없는 모듈을 조정하십시오. TypeScript의 선언 병합(Declaration merging) 기능 모듈 확장에 대해 알아보기 전에, TypeScript에서 선언 병합이 모듈 확장과 ..