aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/PursLoader/LoaderRef.purs
diff options
context:
space:
mode:
authoreric <thul.eric@gmail.com>2016-01-19 08:41:51 -0500
committereric <thul.eric@gmail.com>2016-01-19 08:41:51 -0500
commit2ecf85616a2b56ec9ff675c8f45b7dcf5607fc86 (patch)
treef8ad39dc0d21ae4add8f2a3877edf24294d2910f /src/PursLoader/LoaderRef.purs
parent94cc1cdd03b9c2115813a698b1e4337bce894321 (diff)
parentc01553307e6fcd0abada0b9b2f9ca8d6bb82b863 (diff)
downloadpurs-loader-2ecf85616a2b56ec9ff675c8f45b7dcf5607fc86.tar.gz
purs-loader-2ecf85616a2b56ec9ff675c8f45b7dcf5607fc86.tar.zst
purs-loader-2ecf85616a2b56ec9ff675c8f45b7dcf5607fc86.zip
Merge pull request #34 from ethul/topic/psc-webpack-plugin
Topic/psc webpack plugin
Diffstat (limited to 'src/PursLoader/LoaderRef.purs')
-rw-r--r--src/PursLoader/LoaderRef.purs13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/PursLoader/LoaderRef.purs b/src/PursLoader/LoaderRef.purs
index 33c4f7e..87d6006 100644
--- a/src/PursLoader/LoaderRef.purs
+++ b/src/PursLoader/LoaderRef.purs
@@ -1,6 +1,7 @@
1module PursLoader.LoaderRef 1module PursLoader.LoaderRef
2 ( LoaderRef() 2 ( LoaderRef()
3 , Loader() 3 , Loader()
4 , AsyncCallback()
4 , async 5 , async
5 , cacheable 6 , cacheable
6 , query 7 , query
@@ -17,16 +18,18 @@ import Control.Monad.Eff.Exception (Error())
17import Data.Function (Fn3(), runFn3) 18import Data.Function (Fn3(), runFn3)
18import Data.Maybe (Maybe(), fromMaybe, isJust) 19import Data.Maybe (Maybe(), fromMaybe, isJust)
19 20
21type AsyncCallback eff = Maybe Error -> String -> Eff (loader :: Loader | eff) Unit
22
20data LoaderRef 23data LoaderRef
21 24
22foreign import data Loader :: ! 25foreign import data Loader :: !
23 26
24foreign import asyncFn :: forall eff a. Fn3 (Maybe Error -> Boolean) 27foreign import asyncFn :: forall eff. Fn3 (Maybe Error -> Boolean)
25 (Error -> Maybe Error -> Error) 28 (Error -> Maybe Error -> Error)
26 LoaderRef 29 LoaderRef
27 (Eff (loader :: Loader | eff) (Maybe Error -> a -> Eff (loader :: Loader | eff) Unit)) 30 (Eff (loader :: Loader | eff) (AsyncCallback eff))
28 31
29async :: forall eff a. LoaderRef -> Eff (loader :: Loader | eff) (Maybe Error -> a -> Eff (loader :: Loader | eff) Unit) 32async :: forall eff. LoaderRef -> Eff (loader :: Loader | eff) (Maybe Error -> String -> Eff (loader :: Loader | eff) Unit)
30async ref = runFn3 asyncFn isJust fromMaybe ref 33async ref = runFn3 asyncFn isJust fromMaybe ref
31 34
32foreign import cacheable :: forall eff. LoaderRef -> Eff (loader :: Loader | eff) Unit 35foreign import cacheable :: forall eff. LoaderRef -> Eff (loader :: Loader | eff) Unit