aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/PursLoader/LoaderRef.purs
diff options
context:
space:
mode:
Diffstat (limited to 'src/PursLoader/LoaderRef.purs')
-rw-r--r--src/PursLoader/LoaderRef.purs40
1 files changed, 0 insertions, 40 deletions
diff --git a/src/PursLoader/LoaderRef.purs b/src/PursLoader/LoaderRef.purs
deleted file mode 100644
index 140d94a..0000000
--- a/src/PursLoader/LoaderRef.purs
+++ /dev/null
@@ -1,40 +0,0 @@
1module PursLoader.LoaderRef
2 ( LoaderRef()
3 , Loader()
4 , AsyncCallback()
5 , async
6 , cacheable
7 , clearDependencies
8 , addDependency
9 , resourcePath
10 ) where
11
12import Prelude (Unit())
13
14import Control.Monad.Eff (Eff())
15import Control.Monad.Eff.Exception (Error())
16
17import Data.Function (Fn3(), runFn3)
18import Data.Maybe (Maybe(), fromMaybe, isJust)
19
20type AsyncCallback eff = Maybe Error -> String -> Eff (loader :: Loader | eff) Unit
21
22data LoaderRef
23
24foreign import data Loader :: !
25
26foreign import asyncFn :: forall eff. Fn3 (Maybe Error -> Boolean)
27 (Error -> Maybe Error -> Error)
28 LoaderRef
29 (Eff (loader :: Loader | eff) (AsyncCallback eff))
30
31async :: forall eff. LoaderRef -> Eff (loader :: Loader | eff) (Maybe Error -> String -> Eff (loader :: Loader | eff) Unit)
32async ref = runFn3 asyncFn isJust fromMaybe ref
33
34foreign import cacheable :: forall eff. LoaderRef -> Eff (loader :: Loader | eff) Unit
35
36foreign import clearDependencies :: forall eff. LoaderRef -> Eff (loader :: Loader | eff) Unit
37
38foreign import resourcePath :: LoaderRef -> String
39
40foreign import addDependency :: forall eff. LoaderRef -> String -> Eff (loader :: Loader | eff) Unit