diff options
Diffstat (limited to 'src/PursLoader/LoaderRef.purs')
-rw-r--r-- | src/PursLoader/LoaderRef.purs | 40 |
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 @@ | |||
1 | module PursLoader.LoaderRef | ||
2 | ( LoaderRef() | ||
3 | , Loader() | ||
4 | , AsyncCallback() | ||
5 | , async | ||
6 | , cacheable | ||
7 | , clearDependencies | ||
8 | , addDependency | ||
9 | , resourcePath | ||
10 | ) where | ||
11 | |||
12 | import Prelude (Unit()) | ||
13 | |||
14 | import Control.Monad.Eff (Eff()) | ||
15 | import Control.Monad.Eff.Exception (Error()) | ||
16 | |||
17 | import Data.Function (Fn3(), runFn3) | ||
18 | import Data.Maybe (Maybe(), fromMaybe, isJust) | ||
19 | |||
20 | type AsyncCallback eff = Maybe Error -> String -> Eff (loader :: Loader | eff) Unit | ||
21 | |||
22 | data LoaderRef | ||
23 | |||
24 | foreign import data Loader :: ! | ||
25 | |||
26 | foreign import asyncFn :: forall eff. Fn3 (Maybe Error -> Boolean) | ||
27 | (Error -> Maybe Error -> Error) | ||
28 | LoaderRef | ||
29 | (Eff (loader :: Loader | eff) (AsyncCallback eff)) | ||
30 | |||
31 | async :: forall eff. LoaderRef -> Eff (loader :: Loader | eff) (Maybe Error -> String -> Eff (loader :: Loader | eff) Unit) | ||
32 | async ref = runFn3 asyncFn isJust fromMaybe ref | ||
33 | |||
34 | foreign import cacheable :: forall eff. LoaderRef -> Eff (loader :: Loader | eff) Unit | ||
35 | |||
36 | foreign import clearDependencies :: forall eff. LoaderRef -> Eff (loader :: Loader | eff) Unit | ||
37 | |||
38 | foreign import resourcePath :: LoaderRef -> String | ||
39 | |||
40 | foreign import addDependency :: forall eff. LoaderRef -> String -> Eff (loader :: Loader | eff) Unit | ||