miso-0.21.1.0: A tasty Haskell front-end framework

Copyright(C) 2016-2018 David M. Johnson
LicenseBSD3-style (see the file LICENSE)
MaintainerDavid M. Johnson <djohnson.m@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Miso

Description

 

Synopsis

Documentation

miso :: Eq model => (URI -> App model action) -> JSM () Source #

Runs an isomorphic miso application Assumes the pre-rendered DOM is already present

startApp :: Eq model => App model action -> JSM () Source #

Runs a miso application

module Miso.Event

module Miso.Html

module Miso.Types

module Miso.Util

type JSM = IO Source #

When compiled without the jsaddle Cabal flag, this is just a type synonym for IO. When the jsaddle flag is enabled, this resolves to the JSM type defined in jsaddle.

forkJSM :: JSM () -> JSM () Source #

asyncCallback #

Arguments

:: IO ()

the action that the callback runs

-> IO (Callback (IO ()))

the callback

Make a callback (JavaScript function) that runs the supplied IO action in an asynchronous thread when called.

Call releaseCallback when done with the callback, freeing data referenced by the IO action.

asyncCallback1 #

Arguments

:: (JSVal -> IO ())

the function that the callback calls

-> IO (Callback (JSVal -> IO ()))

the calback

ghcjsPure :: a -> JSM a Source #

addEventListener :: JSVal -> JSString -> (JSVal -> IO ()) -> IO () Source #

windowInnerHeight :: IO Int Source #

Retrieves inner height

windowInnerWidth :: IO Int Source #

Retrieves outer height

now :: IO Double Source #

Retrieve high performance time stamp

consoleLog :: JSVal -> IO () Source #

Console-logging

stringify :: ToJSON json => json -> IO JSString Source #

Converts a JS object into a JSON string

parse :: FromJSON json => JSVal -> IO json Source #

Parses a JSString

clearBody :: IO () Source #

Clear the document body. This is particularly useful to avoid creating multiple copies of your app when running in GHCJSi.

objectToJSON Source #

Arguments

:: JSVal

decodeAt :: [JSString]

-> JSVal

object with impure references to the DOM

-> IO JSVal 

set :: ToJSVal v => JSString -> v -> Object -> IO () Source #

Set property on object

diff' Source #

Arguments

:: Object

current object

-> Object

new object

-> JSVal

parent node

-> JSVal

document

-> IO () 

copyDOMIntoVTree :: JSVal -> IO () Source #

Copies DOM pointers into virtual dom entry point into isomorphic javascript

swapCallbacks :: IO () Source #

Pins down the current callbacks for clearing later

releaseCallbacks :: IO () Source #

Releases callbacks registered by the virtual DOM.

focus :: JSString -> JSM () Source #

Fails silently if the element is not found.

Analogous to document.getElementById(id).focus().

blur :: JSString -> JSM () Source #

Fails silently if the element is not found.

Analogous to document.getElementById(id).blur()

scrollIntoView :: JSString -> IO () Source #

Calls document.getElementById(id).scrollIntoView()

alert :: JSString -> JSM () Source #

Calls the alert() function.