Skip to content

Commit

Permalink
Use triple quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
garyb committed Nov 16, 2014
1 parent 2707333 commit 0dd9aa3
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/VirtualDOM/VTree.purs
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,24 @@ type Namespace = String
foreign import unsafeNull
"var unsafeNull = null;" :: forall a. a

foreign import vnode'
"var vnode$prime = (function() {\
\ var VNode = require('vtree/vnode');\
\ return function (name, props, children, key, ns) {\
\ return new VNode(name, props, children, key, ns);\
\ };\
\}());" :: forall props. Fn5 TagName { | props } [VTree] Key Namespace VTree
foreign import vnode' """
var vnode$prime = (function() {
var VNode = require('vtree/vnode');
return function (name, props, children, key, ns) {
return new VNode(name, props, children, key, ns);
};
}());
""" :: forall props. Fn5 TagName { | props } [VTree] Key Namespace VTree

vnode :: forall props. TagName -> { | props } -> [VTree] -> Maybe Key -> Maybe Namespace -> VTree
vnode name props children key ns =
runFn5 vnode' name props children (fromMaybe unsafeNull key) (fromMaybe unsafeNull ns)

foreign import vtext
"var vtext = (function() {\
\ var VText = require('vtree/vtext');\
\ return function (text) {\
\ return new VText(text);\
\ };\
\}());" :: String -> VTree
foreign import vtext """
var vtext = (function() {
var VText = require('vtree/vtext');
return function (text) {
return new VText(text);
};
}());
""" :: String -> VTree

0 comments on commit 0dd9aa3

Please sign in to comment.