Skip to content

Commit

Permalink
Remove Unit argument from create functions. (purescript-web#46)
Browse files Browse the repository at this point in the history
* Remove Unit argument from create functions.

* Remove unused Unit import

Co-authored-by: JordanMartinez <jordanalex.martinez@gmail.com>
  • Loading branch information
thomashoneyman and JordanMartinez authored Dec 12, 2020
1 parent cc6c964 commit ed00360
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
4 changes: 1 addition & 3 deletions src/Web/HTML/HTMLAudioElement.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"use strict";

exports.create = function () {
return function () {
return new Audio();
};
return new Audio();
};

exports.createWithURL = function (url) {
Expand Down
5 changes: 2 additions & 3 deletions src/Web/HTML/HTMLAudioElement.purs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Web.HTML.HTMLAudioElement
module Web.HTML.HTMLAudioElement
( HTMLAudioElement
, fromHTMLElement
, fromElement
Expand All @@ -21,7 +21,6 @@ module Web.HTML.HTMLAudioElement

import Data.Maybe (Maybe)
import Effect (Effect)
import Prelude (Unit)
import Unsafe.Coerce (unsafeCoerce)
import Web.DOM (ChildNode, Element, Node, NonDocumentTypeChildNode, ParentNode)
import Web.Event.EventTarget (EventTarget)
Expand Down Expand Up @@ -79,7 +78,7 @@ toParentNode = unsafeCoerce
toEventTarget :: HTMLAudioElement -> EventTarget
toEventTarget = unsafeCoerce

foreign import create :: Unit -> Effect HTMLAudioElement
foreign import create :: Effect HTMLAudioElement
foreign import createWithURL :: String -> Effect HTMLAudioElement

create' :: String -> Effect HTMLAudioElement
Expand Down
5 changes: 1 addition & 4 deletions src/Web/HTML/HTMLImageElement.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"use strict";

exports.create = function () {
return function () {
return new Image();
};
return new Image();
};

exports.createWithDimensions = function (width) {
Expand Down Expand Up @@ -190,7 +188,6 @@ exports.setReferrerPolicy = function (referrerPolicy) {
};
};


// ----------------------------------------------------------------------------

exports._decoding = function (image) {
Expand Down
3 changes: 1 addition & 2 deletions src/Web/HTML/HTMLImageElement.purs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ toParentNode = unsafeCoerce
toEventTarget :: HTMLImageElement -> EventTarget
toEventTarget = unsafeCoerce


foreign import create :: Unit -> Effect HTMLImageElement
foreign import create :: Effect HTMLImageElement
foreign import createWithDimensions :: Int -> Int -> Effect HTMLImageElement

create' :: Int -> Int -> Effect HTMLImageElement
Expand Down

0 comments on commit ed00360

Please sign in to comment.