본문 바로가기

FE/React & RN36

[react-saga] redux-thunk의 경우엔 함수를 디스패치 할 수 있게 해주는 미들웨어였지요? redux-saga의 경우엔, 액션을 모니터링하고 있다가, 특정 액션이 발생하면 이에 따라 특정 작업을 하는 방식으로 사용합니다. 여기서 특정 작업이란, 특장 자바스크립트를 실행하는 것 일수도 있고, 다른 액션을 디스패치 하는 것 일수도 있고, 현재 상태를 불러오는 것 일수도 있습니다. redux-saga는 redux-thunk로 못하는 다양한 작업들을 처리 할 수 있습니다. 예를 들자면.. 비동기 작업을 할 때 기존 요청을 취소 처리 할 수 있습니다 특정 액션이 발생했을 때 이에 따라 다른 액션이 디스패치되게끔 하거나, 자바스크립트 코드를 실행 할 수 있습니다. 웹소켓을 사용하는 경우 Channel 이라는 기능을 사용하여.. 2021. 6. 9.
JSX란? jsx 파일 const myelement = I Love JSX!; ReactDOM.render(myelement, document.getElementById('root')); jsx파일 아닌경우 const myelement = React.createElement('h1', {}, 'I do not use JSX!'); ReactDOM.render(myelement, document.getElementById('root')); HTML elements 가 동작 되도록 도와준다. https://ko.reactjs.org/docs/introducing-jsx.html 2021. 5. 26.
TypeScript ( tsc vs babel 설정 ) tsc vs babel how to convert from TypeScript to JavaScript Is your build output mostly the same as your source input files? Use tsc Do you need a build pipeline with multiple potential outputs? Use babel for transpiling and tsc for type checking 바벨을 사용해야 하는 이유 바벨7 이전 TS > TS compiler > JS > Babel > JS 순서 웹팩은 두개의 컴파일러를 함께 사용하기 위해 사용된다. ( babel, tsc ) 웹팹 설정을 비틀어 *.ts 를 타입스크립트로 입력한 다음 결과를 바벨에 제공한다. .. 2021. 5. 26.
[ Redux + Saga ] async/await이든 Redux-Saga 사용상의 이점은 크게 없다. 하지만 좀 더 자세한 동작에 대한 handling을 가능하게 하는 것이 Redux-Saga이다(takeLatest(), next()등) 코드 량은 현저히 async/awiat가 적다. 질문 왜 Rudx를 사용하고 saga, thunks를 사용할까? Redux became the de facto standard as a data management technology for ReactJS applications. It is a convenient and easy method of structuring data in an application and displaying it on the client. Yet we hit a certai.. 2021. 4. 11.