diff options
author | eric thul <thul.eric@gmail.com> | 2015-07-18 17:07:38 -0400 |
---|---|---|
committer | eric thul <thul.eric@gmail.com> | 2015-07-18 17:07:38 -0400 |
commit | 3610dff1b8308a810d827f0595832b326deff37b (patch) | |
tree | a4858f5e16e3df01aee249ad53b5b76f90fb97de /src/LoaderRef.purs | |
parent | 418c9429609c6d80ddaf7df41e0ee64192e2ec7b (diff) | |
download | purs-loader-3610dff1b8308a810d827f0595832b326deff37b.tar.gz purs-loader-3610dff1b8308a810d827f0595832b326deff37b.tar.zst purs-loader-3610dff1b8308a810d827f0595832b326deff37b.zip |
Add FFI JavaScript as a webpack dependency
Resolves #18
Diffstat (limited to 'src/LoaderRef.purs')
-rw-r--r-- | src/LoaderRef.purs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/LoaderRef.purs b/src/LoaderRef.purs index 2567b1e..f1efa04 100644 --- a/src/LoaderRef.purs +++ b/src/LoaderRef.purs | |||
@@ -4,6 +4,9 @@ module PursLoader.LoaderRef | |||
4 | , async | 4 | , async |
5 | , cacheable | 5 | , cacheable |
6 | , query | 6 | , query |
7 | , clearDependencies | ||
8 | , addDependency | ||
9 | , resourcePath | ||
7 | ) where | 10 | ) where |
8 | 11 | ||
9 | import Control.Monad.Eff (Eff()) | 12 | import Control.Monad.Eff (Eff()) |
@@ -48,3 +51,24 @@ foreign import query """ | |||
48 | function query(ref){ | 51 | function query(ref){ |
49 | return ref.query; | 52 | return ref.query; |
50 | }""" :: LoaderRef -> String | 53 | }""" :: LoaderRef -> String |
54 | |||
55 | foreign import clearDependencies """ | ||
56 | function clearDependencies(ref){ | ||
57 | return function(){ | ||
58 | return ref.clearDependencies(); | ||
59 | }; | ||
60 | }""" :: forall eff. LoaderRef -> Eff (loader :: Loader | eff) Unit | ||
61 | |||
62 | foreign import resourcePath """ | ||
63 | function resourcePath(ref){ | ||
64 | return ref.resourcePath; | ||
65 | }""" :: LoaderRef -> String | ||
66 | |||
67 | foreign import addDependency """ | ||
68 | function addDependency(ref){ | ||
69 | return function(dep){ | ||
70 | return function(){ | ||
71 | return ref.addDependency(dep); | ||
72 | }; | ||
73 | }; | ||
74 | }""" :: forall eff. LoaderRef -> String -> Eff (loader :: Loader | eff) Unit | ||