Skip to content

Commit

Permalink
rm Base.getindex for DashBase.Component methods
Browse files Browse the repository at this point in the history
these were moved to `DashBase.jl` during
the DashBase v1 push
  • Loading branch information
etpinard committed Aug 4, 2023
1 parent d01ce73 commit bcb5b50
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions src/app/dashapp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,6 @@ mutable struct DashApp

end

const VecChildTypes = Union{NTuple{N, DashBase.Component} where {N}, Vector{<:DashBase.Component}}

function Base.getindex(component::DashBase.Component, id::AbstractString)
component.id == id && return component
hasproperty(component, :children) || return nothing
cc = component.children
return if cc isa Union{VecChildTypes, DashBase.Component}
cc[id]
elseif cc isa AbstractVector
identity.(filter(x->hasproperty(x, :id), cc))[id]
else
nothing
end
end
function Base.getindex(children::VecChildTypes, id::AbstractString)
for element in children
element.id == id && return element
el = element[id]
el !== nothing && return el
end
end

#only name, index_string and layout are available to set
function Base.setproperty!(app::DashApp, property::Symbol, value)
property == :index_string && return set_index_string!(app, value)
Expand Down

0 comments on commit bcb5b50

Please sign in to comment.