Skip to content

Conversation

@shmoobies
Copy link

'ClassCastException {message_8yp7un$_0: "Illegal cast" ' at fetchVideo

val response = window
.fetch("https://my-json-server.typicode.com/kotlin-hands-on/kotlinconf-json/videos/$id")
.await()
.json()
.await()
return response as Video

This at least cleared the issue
return window
.fetch("https://my-json-server.typicode.com/kotlin-hands-on/kotlinconf-json/videos/$id")
.await()
.json()
.await().unsafeCast<Video>()

Use styled components
Add Video data class and example lists for unwatched and watched videos
Introduce VideoList component with selection mechanism (state and properties)
Pass video selection handlers to video list
Add "Mark as (un)watched" button to video player
Move (un)watched videos to AppState
Use react-player in video player
Add Email and Telegram share buttons to video player
@SebastianAigner
Copy link
Member

Thanks for pointing this out.
In the last iteration, we've moved from the unsafe cast to using kx.serialization as a serialization framework, which does away with this problem entirely. :)

@SebastianAigner SebastianAigner deleted the step-07-using-external-rest-api branch November 11, 2021 14:24
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.

3 participants