Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Commit 3d8fb83

Browse files
committed
Issue #35 / PR Feedback
- reorder parameters - remove nonstandard parameter
1 parent f1a537d commit 3d8fb83

File tree

2 files changed

+36
-38
lines changed

2 files changed

+36
-38
lines changed

src/DOM/HTML/Location.js

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ exports.hash = function (location) {
99
};
1010
};
1111

12-
exports.setHash = function (location) {
13-
return function (hash) {
12+
exports.setHash = function (hash) {
13+
return function (location) {
1414
return function () {
1515
location.hash = hash;
1616
};
@@ -23,8 +23,8 @@ exports.host = function (location) {
2323
};
2424
};
2525

26-
exports.setHost = function (location) {
27-
return function (host) {
26+
exports.setHost = function (host) {
27+
return function (location) {
2828
return function () {
2929
location.host = host;
3030
};
@@ -37,8 +37,8 @@ exports.hostname = function (location) {
3737
};
3838
};
3939

40-
exports.setHostname = function (location) {
41-
return function (hostname) {
40+
exports.setHostname = function (hostname) {
41+
return function (location) {
4242
return function () {
4343
location.hostname = hostname;
4444
};
@@ -51,8 +51,8 @@ exports.href = function (location) {
5151
};
5252
};
5353

54-
exports.setHref = function (location) {
55-
return function (href) {
54+
exports.setHref = function (href) {
55+
return function (location) {
5656
return function () {
5757
location.href = href;
5858
};
@@ -65,8 +65,8 @@ exports.origin = function (location) {
6565
};
6666
};
6767

68-
exports.setOrigin = function (location) {
69-
return function (origin) {
68+
exports.setOrigin = function (origin) {
69+
return function (location) {
7070
return function () {
7171
location.origin = origin;
7272
};
@@ -79,8 +79,8 @@ exports.pathname = function (location) {
7979
};
8080
};
8181

82-
exports.setPathname = function (location) {
83-
return function (pathname) {
82+
exports.setPathname = function (pathname) {
83+
return function (location) {
8484
return function () {
8585
location.pathname = pathname;
8686
};
@@ -93,8 +93,8 @@ exports.port = function (location) {
9393
};
9494
};
9595

96-
exports.setPort = function (location) {
97-
return function (port) {
96+
exports.setPort = function (port) {
97+
return function (location) {
9898
return function () {
9999
location.port = port;
100100
};
@@ -107,8 +107,8 @@ exports.protocol = function (location) {
107107
};
108108
};
109109

110-
exports.setProtocol = function (location) {
111-
return function (protocol) {
110+
exports.setProtocol = function (protocol) {
111+
return function (location) {
112112
return function () {
113113
location.protocol = protocol;
114114
};
@@ -121,34 +121,32 @@ exports.search = function (location) {
121121
};
122122
};
123123

124-
exports.setSearch = function (location) {
125-
return function (search) {
124+
exports.setSearch = function (search) {
125+
return function (location) {
126126
return function () {
127127
location.search = search;
128128
};
129129
};
130130
};
131131

132-
exports.assign = function (location) {
133-
return function (url) {
132+
exports.assign = function (url) {
133+
return function (location) {
134134
return function () {
135135
location.assign(url);
136136
};
137137
};
138138
};
139139

140-
exports.replace = function (location) {
141-
return function (url) {
140+
exports.replace = function (url) {
141+
return function (location) {
142142
return function () {
143143
location.replace(url);
144144
};
145145
};
146146
};
147147

148148
exports.reload = function (location) {
149-
return function (args) {
150-
return function() {
151-
location.reload(args.forceGet);
152-
};
149+
return function() {
150+
location.reload();
153151
};
154152
};

src/DOM/HTML/Location.purs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,32 @@ import DOM
3131
import DOM.HTML.Types
3232

3333
foreign import hash :: forall eff. Location -> Eff (dom :: DOM | eff) String
34-
foreign import setHash :: forall eff. Location -> String -> Eff (dom :: DOM | eff) Unit
34+
foreign import setHash :: forall eff. String -> Location -> Eff (dom :: DOM | eff) Unit
3535

3636
foreign import host :: forall eff. Location -> Eff (dom :: DOM | eff) String
37-
foreign import setHost :: forall eff. Location -> String -> Eff (dom :: DOM | eff) Unit
37+
foreign import setHost :: forall eff. String -> Location -> Eff (dom :: DOM | eff) Unit
3838

3939
foreign import hostname :: forall eff. Location -> Eff (dom :: DOM | eff) String
40-
foreign import setHostname :: forall eff. Location -> String -> Eff (dom :: DOM | eff) Unit
40+
foreign import setHostname :: forall eff. String -> Location -> Eff (dom :: DOM | eff) Unit
4141

4242
foreign import href :: forall eff. Location -> Eff (dom :: DOM | eff) String
43-
foreign import setHref :: forall eff. Location -> String -> Eff (dom :: DOM | eff) String
43+
foreign import setHref :: forall eff. String -> Location -> Eff (dom :: DOM | eff) String
4444

4545
foreign import origin :: forall eff. Location -> Eff (dom :: DOM | eff) String
46-
foreign import setOrigin :: forall eff. Location -> String -> Eff (dom :: DOM | eff) Unit
46+
foreign import setOrigin :: forall eff. String -> Location -> Eff (dom :: DOM | eff) Unit
4747

4848
foreign import pathname :: forall eff. Location -> Eff (dom :: DOM | eff) String
49-
foreign import setPathname :: forall eff. Location -> String -> Eff (dom :: DOM | eff) Unit
49+
foreign import setPathname :: forall eff. String -> Location -> Eff (dom :: DOM | eff) Unit
5050

5151
foreign import port :: forall eff. Location -> Eff (dom :: DOM | eff) String
52-
foreign import setPort :: forall eff. Location -> String -> Eff (dom :: DOM | eff) Unit
52+
foreign import setPort :: forall eff. String -> Location -> Eff (dom :: DOM | eff) Unit
5353

5454
foreign import protocol :: forall eff. Location -> Eff (dom :: DOM | eff) String
55-
foreign import setProtocol :: forall eff. Location -> String -> Eff (dom :: DOM | eff) Unit
55+
foreign import setProtocol :: forall eff. String -> Location -> Eff (dom :: DOM | eff) Unit
5656

5757
foreign import search :: forall eff. Location -> Eff (dom :: DOM | eff) String
58-
foreign import setSearch :: forall eff. Location -> String -> Eff (dom :: DOM | eff) Unit
58+
foreign import setSearch :: forall eff. String -> Location -> Eff (dom :: DOM | eff) Unit
5959

60-
foreign import assign :: forall eff. Location -> String -> Eff (dom :: DOM | eff) Unit
61-
foreign import replace :: forall eff. Location -> String -> Eff (dom :: DOM | eff) Unit
62-
foreign import reload :: forall eff. Location -> { forceGet :: Boolean } -> Eff (dom :: DOM | eff) Unit
60+
foreign import assign :: forall eff. String -> Location -> Eff (dom :: DOM | eff) Unit
61+
foreign import replace :: forall eff. String -> Location -> Eff (dom :: DOM | eff) Unit
62+
foreign import reload :: forall eff. Location -> Eff (dom :: DOM | eff) Unit

0 commit comments

Comments
 (0)