You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
현재 장르가 클라이언트와 서버에서 꼭 동기화가 되어야 하는 중요한 정보이기 때문에 장르를 서버에서 받아와서 쓴다
그런데 장르를 가지고 요청을 보낼 때 클라이언트 코드에서 서버에서 받은 장르만 사용할 것이라는 보장이 없다
가장 안전한 것은 타입 시스템이다
그러나 서버에서 받은 장르를 타입으로 만드는 것이 가능한가?
타입은 런타임에서는 없는 것인데?
결론: 서버에서 장르를 받아서 쓰는 게 의도한대로 가장 안전한 방법인지 모르겠다
차라리 타입으로 선언해서 쓰고 해당 타입을 잘 관리하는 것이 나을 수 있다
Beta Was this translation helpful? Give feedback.
All reactions