plugin: Migrate 'merge' utility into Dictionary module

This commit is contained in:
Lucien Greathouse
2019-01-04 10:59:47 -08:00
parent 5816bb64dc
commit 1582d8f504
3 changed files with 43 additions and 43 deletions

View File

@@ -2,29 +2,10 @@ local TextService = game:GetService("TextService")
local Roact = require(script:FindFirstAncestor("Rojo").Roact)
local Dictionary = require(script.Parent.Parent.Dictionary)
local e = Roact.createElement
local None = newproxy(false)
local function merge(...)
local output = {}
for i = 1, select("#", ...) do
local source = select(i, ...)
if source ~= nil then
for key, value in pairs(source) do
if value == None then
output[key] = nil
else
output[key] = value
end
end
end
end
return output
end
local FitText = Roact.Component:extend("FitText")
function FitText:init()
@@ -34,9 +15,9 @@ end
function FitText:render()
local kind = self.props.Kind
local containerProps = merge(self.props, {
Kind = None,
Padding = None,
local containerProps = Dictionary.merge(self.props, {
Kind = Dictionary.None,
Padding = Dictionary.None,
Size = self.sizeBinding
})