Skip to content

Commit dd7ab41

Browse files
committed
chore: simplify create params
1 parent 09e5688 commit dd7ab41

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

spec/slot_spec.lua

-9
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ describe("Awesome-slot", function()
2323
target = target,
2424
signal = "signal",
2525
slot = function() end,
26-
slot_params = { key = "value" },
2726
}
2827

2928
assert.is_not_nil(s)
@@ -36,7 +35,6 @@ describe("Awesome-slot", function()
3635
target = target,
3736
signal = "signal",
3837
slot = function() end,
39-
slot_params = { key = "value" },
4038
}
4139

4240
slot.remove(s)
@@ -93,8 +91,6 @@ describe("Awesome-slot", function()
9391
target = target,
9492
signal = "signal",
9593
slot = function() end,
96-
slot_params = { key = "value" },
97-
connect = true,
9894
}
9995

10096
slot.disconnect(s)
@@ -109,7 +105,6 @@ describe("Awesome-slot", function()
109105
target = target,
110106
signal = "signal",
111107
slot = function() end,
112-
slot_params = { key = "value" },
113108
}
114109

115110
assert.is_not_nil(slot.get_slot(s))
@@ -124,7 +119,6 @@ describe("Awesome-slot", function()
124119
target = target,
125120
signal = "signal",
126121
slot = function() end,
127-
slot_params = { key = "value" },
128122
}
129123

130124
assert.is_not_nil(slot.get_slot(id))
@@ -137,7 +131,6 @@ describe("Awesome-slot", function()
137131
target = target,
138132
signal = "signal",
139133
slot = function() end,
140-
slot_params = { key = "value" },
141134
}
142135

143136
assert.is_not_nil(s.id)
@@ -158,7 +151,6 @@ describe("Awesome-slot", function()
158151
signal = signal_name,
159152
slot = callback,
160153
slot_params = params,
161-
connect = true,
162154
}
163155

164156
target:emit_signal(signal_name)
@@ -180,7 +172,6 @@ describe("Awesome-slot", function()
180172
target = target,
181173
signal = signal_name,
182174
slot = callback,
183-
connect = true,
184175
}
185176

186177
target:emit_signal(signal_name, 1, 2, 3)

src/awesome-slot/init.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ end
107107
-- @tparam any params.target The slot target object.
108108
-- @tparam string params.signal The signal the slot connects to.
109109
-- @tparam function params.slot The callback function to connect to the signal.
110-
-- @tparam table params.slot_params The parameters to pass to the callback
110+
-- @tparam[opt] table params.slot_params The parameters to pass to the callback
111111
-- function. (The signal will invoke the callback function with this table as
112112
-- parameter)
113113
-- @tparam[opt=true] boolean params.connect Connect the slot now.

0 commit comments

Comments
 (0)