analogcoding

8/2 - 4주 프로젝트 본문

Be well coding/In Immersive

8/2 - 4주 프로젝트

be well 2019. 8. 3. 01:03

Toy 43번 문제. linkedlist cycle 구현.

 

var hasCycle = function(linkedList) {
  let Cycle = {};

  if (linkedList.next === linkedList) {
    return true;
  } else if (linkedList.next === null) {
    return false;
  } else {
    while (linkedList.next !== null) {
      if (Cycle[linkedList.value] === undefined) {
        Cycle[linkedList.value] = "visited";
      } else {
        // 돌았던 value 들의 값이 visited 면 cycle 성립
        return true;
      }
      linkedList = linkedList.next;
    }
  }
  return false;
};

Apollo fetching

 

Query : 렌더와 동시에 요청

 

Mutation : 콜백함수 실행 시 요청

 

 

Type script & react apollo 구현 중 오류 발생.

 

playGround 를 참고하며 Query 요청을 보내서 data 를 받아오는 것 까지는 성공!

 

그러나... 콘솔에는 잘 찍히던 친구가..

 

오류를 토하기 시작했다. 분명 typeof 도 object 로 잘 찍히는데 ..

 

이 오류는 typeScropt 오류였다. 아직 해결하지 못했지만 Ts 오류 코드를 검색하니 type 설정이 제대로 되지 않아서

 

type 지정이 ??? ||  undefined 이런 식으로 되어 있어서 발생한 문제인 것 까지는 파악했지만 아직 해결은 하지 못했다.

 

오늘은 하루 종일 Query 문과 typescript 에 익숙해지는 것에 시간을 쏟았다.. Apollo 와 typescript 정리는 주말에 ..

'Be well coding > In Immersive' 카테고리의 다른 글

8/5 - 4주 프로젝트  (0) 2019.08.06
8/3 - 4주 프로젝트  (0) 2019.08.05
8/1 - 4주 프로젝트  (0) 2019.08.01
7/31 - 4주 프로젝트  (0) 2019.08.01
7/30 - 4주 프로젝트 / GraphQL , JWT , PASSPORT  (0) 2019.07.30
Comments