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

[HaveTo] Task 컴포넌트와 .task 모디파이어의 차이 공부하기 #1

Open
sunshiningsoo opened this issue Jun 29, 2022 · 4 comments
Assignees
Labels

Comments

@sunshiningsoo
Copy link
Owner

Task.task() 의 차이에 대해 공부하기

@sunshiningsoo
Copy link
Owner Author

조금 더 생각해보는 것은 view와 modifier 사이의 관계는 어떠한지를 찾아봐야 겠음

@sunshiningsoo
Copy link
Owner Author

@sunshiningsoo
Copy link
Owner Author

Task 컴포넌트의 경우, async한 상황이 아닌 component의 맥락에서 async한 동작들의 선언이 가능하게 해준다
.task 모디파이어의 경우, 예시로, imageFetch를 onAppear에서 try await, onDisappear에서 task가 필요한 액션이 cancel되었다면 task를 직접 cancel해주어야 하지만, task 모디파이어 선언으로 두가지 액션을 .task안에 선언을 하는 것으로 완성할 수 있음

@sunshiningsoo
Copy link
Owner Author

165c90a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant