aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/PursLoader/LoaderRef.purs
diff options
context:
space:
mode:
authoreric <thul.eric@gmail.com>2016-05-21 22:44:27 -0400
committereric <thul.eric@gmail.com>2016-05-21 22:44:27 -0400
commitd301b47d8fb7139d11f59c5d969bdde6132a8230 (patch)
tree10a7677d88c750b360f141b2e9d5ca095e01ab4c /src/PursLoader/LoaderRef.purs
parent777472b3830cb3d2ff3390003ea422c6d4522715 (diff)
parent17acb575860cf1bed9e1f6d992a9b7cd66057464 (diff)
downloadpurs-loader-d301b47d8fb7139d11f59c5d969bdde6132a8230.tar.gz
purs-loader-d301b47d8fb7139d11f59c5d969bdde6132a8230.tar.zst
purs-loader-d301b47d8fb7139d11f59c5d969bdde6132a8230.zip
Merge pull request #47 from alexmingoia/topic/refactor
Refactor to compile independently of purescript-webpack-plugin.
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