return function(L,p)L=L or{}local A={}for L,p in pairs(L)do A[L]=p end if p.type=="\080\079\082\084\065\076\095\065\067\084\073\086\065\084\069"then A[p.portal]=true end return A end
return function(state,action)
    state = state or {}
    local newState = {}

    for portal,active in pairs(state) do
        newState[portal] = active
    end

    if action.type == "PORTAL_ACTIVATE" then
        newState[action.portal] = true
    end

    return newState
end