Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#846] [3.0] chart- props.data / props.option update 로직 이슈 #847

Merged
merged 1 commit into from
Jul 21, 2021

Conversation

jhee564
Copy link
Collaborator

@jhee564 jhee564 commented Jul 21, 2021

기존 문제점

        await watch(() => props.data, (curr) => {
          const newData = defaultsDeep({}, curr, normalizedData);
  • props.data 데이터를 watch하는 과정에서 신규 데이터(curr)와 차트의 기본 데이터 (DEFAULT_DATA)를 합쳐야 하는데
  • normalizedData( 컴포넌트 생성시점의 props.data + DEFAULT_DATA)와 합쳐 문제 발생

해결

  1. 인자로 전달받아 normalized된 데이터를 반환하는 함수 생성
    • 해당 함수는 전달받은 데이터와 사전 정의된 차트의 기본데이터를 합치는 일만 함

- getNormalizedXXX 함수를 만들고 인자로 props값을 넘겨 신규 props값과 컴포넌트 생성시점의 props값이 얽히지 않도록 함
@kdeun1 kdeun1 merged commit 5aad534 into 3.0 Jul 21, 2021
@kdeun1 kdeun1 deleted the 846_3.0_chart_props_watch_issue branch July 21, 2021 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants