Created
March 23, 2018 17:36
-
-
Save FruitieX/dc8d06e3d4cfa3a9e3e99ebb9102f106 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eval :: Query ~> H.ComponentDSL FrontendState Query Message (Aff _) | |
-- Handle initialization | |
eval (Init next) = do | |
-- Initialize YouTube player | |
player <- liftAff $ YT.initPlayer "player" | |
-- Player's 'onReady' handler, here we should call updatePlayerState with the *current* state | |
(\p -> do | |
let (state :: FrontendState) = H.get -- This won't work as we're in Eff here... :( | |
launchAff_ $ updatePlayerState state p | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment