ChifiSource / Toolips.jl

a manic web-development framework
https://toolips.app
MIT License
60 stars 1 forks source link

improvement to Component constructors #66

Closed emmaccode closed 2 years ago

emmaccode commented 2 years ago

design

We carry this design philosiphy:

julia> function t(name::String, args::Pair{String, String} ...; moreagrs ...)
                  println(args, moreagrs)
                  println(typeof(args))
                  end
t (generic function with 1 method)

julia> t("hello", "a" => "b", width = 5)
("a" => "b",)Base.Pairs(:width => 5)
Tuple{Pair{String, String}}

code like this

Component(name::String, tag::String, args::Tuple{Pair{String, String}' keywargs ...)
# this addition, then the changes to subsequent methods across the entire base
#   would make creating and composing components a lot easier, along with the 

new sub-type, we need another layer of abstraction.

New sub-type! AbstractComponent <: Servable

emmaccode commented 2 years ago

so then all of the basic elemetns included with the toolips base first would adopt this new thing, basically you provide the pairs you want to apply, then the key-words you want to apply. from there it will just be knowing the keywords!

emmaccode commented 2 years ago

So happy this one is done.