jsaddle-dom-0.10.0.0: src/JSDOM/Generated/VoidFunction.hs
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webidl (webref). Do not edit.
module JSDOM.Generated.VoidFunction
(newVoidFunction, newVoidFunctionSync, newVoidFunctionAsync, VoidFunction)
where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import Language.Javascript.JSaddle (JSM, JSVal, JSString, toJSVal, valToBool, valToNumber, js, jss, jsf, jsg, new, function, asyncFunction, jsUndefined, jsNull)
import JSDOM.Types
import JSDOM.Generated.Enums
newVoidFunction :: (MonadDOM m) => (JSM ()) -> m VoidFunction
newVoidFunction callback = liftDOM (VoidFunction . Callback <$> function (\ _ _ args -> case args ++ P.repeat jsUndefined of
_ -> do
callback ))
newVoidFunctionSync :: (MonadDOM m) => (JSM ()) -> m VoidFunction
newVoidFunctionSync callback = liftDOM (VoidFunction . Callback <$> function (\ _ _ args -> case args ++ P.repeat jsUndefined of
_ -> do
callback ))
newVoidFunctionAsync :: (MonadDOM m) => (JSM ()) -> m VoidFunction
newVoidFunctionAsync callback = liftDOM (VoidFunction . Callback <$> asyncFunction (\ _ _ args -> case args ++ P.repeat jsUndefined of
_ -> do
callback ))