Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
Remove undocumented isPortal from API
Browse files Browse the repository at this point in the history
  • Loading branch information
LPGhatguy committed Mar 13, 2018
1 parent 36c73cb commit 340e013
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
11 changes: 0 additions & 11 deletions lib/Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,6 @@ function Core.isStatefulElement(element)
return type(element.type) == "table"
end

--[[
Is this element a Portal?
]]
function Core.isPortal(element)
if type(element) ~= "table" then
return false
end

return element.type == Core.Portal
end

--[[
Creates a new Roact element of the given type.
Expand Down
14 changes: 11 additions & 3 deletions lib/Reconciler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ local SingleEventManager = require(script.Parent.SingleEventManager)

local DEFAULT_SOURCE = "\n\t<Use Roact.DEBUG_ENABLE() to enable detailed tracebacks>\n"

local function isPortal(element)
if type(element) ~= "table" then
return false
end

return element.type == Core.Portal
end

local Reconciler = {}

Reconciler._singleEventManager = SingleEventManager.new()
Expand Down Expand Up @@ -79,7 +87,7 @@ function Reconciler.teardown(instanceHandle)

-- Cut our circular reference between the instance and its handle
instanceHandle._instance = nil
elseif Core.isPortal(element) then
elseif isPortal(element) then
for _, child in pairs(instanceHandle._reifiedChildren) do
Reconciler.teardown(child)
end
Expand Down Expand Up @@ -186,7 +194,7 @@ function Reconciler._reifyInternal(element, parent, key, context)
instance:_reify(instanceHandle)

return instanceHandle
elseif Core.isPortal(element) then
elseif isPortal(element) then
-- Portal elements have one or more children.

local target = element.props.target
Expand Down Expand Up @@ -313,7 +321,7 @@ function Reconciler._reconcile(instanceHandle, newElement)
instanceHandle._instance:_update(newElement.props)

return instanceHandle
elseif Core.isPortal(newElement) then
elseif isPortal(newElement) then
if instanceHandle._rbx ~= newElement.props.target then
local parent = instanceHandle._parent
local key = instanceHandle._key
Expand Down

0 comments on commit 340e013

Please sign in to comment.