2023/08 6

[JavaScript] 그림으로 이해하는 자바스크립트 Array

Array 선언 const animal = ["ant", "beer", "cat", "dog", "eagle", "fox", "giraffe"] 길이 얻기 (length) const animal = ["ant", "beer", "cat", "dog", "eagle", "fox", "giraffe"] console.log(animal.length) // 7 Element 얻기 ([idx])const animal = ["ant", "beer", "cat", "dog", "eagle", "fox", "giraffe"] console.log(animal[3]) // "dog" Index 얻기 (indexOf)만약 배열안에 찾는 값이 없다면 -1을 반환.const animal = ["ant", "beer", "c..

[Python] 그림으로 이해하는 파이썬 List

List 선언 animal = [”ant", ”beer”, “cat”, ”dog”, “eagle”, “fox”, “giraffe”] 길이 얻기 (len) animal = [”ant", ”beer”, “cat”, ”dog”, “eagle”, “fox”, “giraffe”] print(len(animal)) // 7 Element 얻기 animal = [”ant", ”beer”, “cat”, ”dog”, “eagle”, “fox”, “giraffe”] print(animal[3]) # "dog" Index 얻기 (index) animal = [”ant", ”beer”, “cat”, ”dog”, “eagle”, “fox”, “giraffe”] print(animal.index("dog")) # 3 앞에 Ele..

[Redux] redux-thunk

Thunk란? 먼저 thunk를 이해해야 redux가 비동기를 어떻게 처리하는지 이해할 수 있다. https://ko.wikipedia.org/wiki/%EC%8D%BD%ED%81%AC 썽크 - 위키백과, 우리 모두의 백과사전 위키백과, 우리 모두의 백과사전. 컴퓨터 프로그래밍에서 썽크(Thunk)는 기존의 서브루틴에 추가적인 연산을 삽입할 때 사용되는 서브루틴이다. 썽크는 주로 연산 결과가 필요할 때까지 연산을 ko.wikipedia.org thunk는 "생각된(think의 과거분사, 실제로 없는 말)" 후 무엇인가를 실행하겠다. 라는 뜻으로, redux에서는 "무엇인가 로직을 처리하고 dispatch를 실행하겠다." 라고 생각하면 된다. 즉, dispatch전 실행될 코드를 thunk로 이해하면 되겠..

FrontEnd/Redux 2023.08.14

[ReduxToolkit] createAsyncThunk

redux에서 비동기함수 처리는 [redux-thunk](https://github.com/reduxjs/redux-thunk)라는 별도의 미들웨어를 통해야 한다. 반면 rtk은 비동기함수 처리를 위해 createAsyncThunk 함수를 내장하고 있다. Thunk란? https://moonscode.tistory.com/249 Redux redux-thunk Thunk란? 먼저 thunk를 이해해야 redux가 비동기를 어떻게 처리하는지 이해할 수 있다. https://ko.wikipedia.org/wiki/%EC%8D%BD%ED%81%AC [썽크 - 위키백과, 우리 모두의 백과사전 위키백과, 우리 모두의 백과사전. moonscode.tistory.com createAsyncThunk란? redux-t..

FrontEnd/Redux 2023.08.14

[Redux] with RTK

특징 SSR이 가능하다. - next-redux-wrapper를 사용하면 SSR에서도 store에 접근이 가능하다. Entity(RTK - slice)간에 조합이 자유롭다. 가장 크게 아래 두 기능이 강력하다. - A Entity의 Action에 따라 B Entity의 상태를 변경할 수 있다. - A Entity Getter, B Entity Getter를 조합해서 (캐싱된) 값을 가져올 수 있다. API createEntityAdapter 정규화된 Entitry 상태를 관리하기 위해 빈번히 사용하는 CRUD 패턴의 Reducer 함수를 제공하는 API Client에서 정규화된 데이터 관리가 필요할까? https://redux.js.org/usage/structuring-reducers/normalizi..

FrontEnd/Redux 2023.08.01