Skip to content

Commit

Permalink
removal of unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaensel committed Feb 7, 2025
1 parent 736dbf5 commit 9b3c9d4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/Elements.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ function vue_integration(::Type{M};
transport::Module = Genie.WebChannels)::String where {M<:ReactiveModel}
model = Base.invokelatest(M)
vue_app = json(model |> Stipple.render)
vue_app = replace(vue_app, "\"$(getchannel(model))\"" => Stipple.channel_js_name)
# the following line is (probably) no longer needed
# vue_app = replace(vue_app, "\"$(getchannel(model))\"" => Stipple.channel_js_name)

# determine global components (registered under ReactiveModel)
comps = Stipple.components(M)
Expand Down
4 changes: 0 additions & 4 deletions src/Stipple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,6 @@ Sets up default Vue.js watchers so that when the value `fieldname` of type `fiel
changed on the frontend, it is pushed over to the backend using `channel`, at a `debounce` minimum time interval.
"""
function watch(vue_app_name::String, fieldname::Symbol, channel::String, debounce::Int, throttle::Int, model::M; jsfunction::String = "")::String where {M<:ReactiveModel}
js_channel = isempty(channel) ?
"window.Genie.Settings.webchannels_default_route" :
"$vue_app_name.channel_"

isempty(jsfunction) &&
(jsfunction = "$vue_app_name.push('$fieldname')")

Expand Down
2 changes: 1 addition & 1 deletion src/stipple/rendering.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function Stipple.render(app::M)::Dict{Symbol,Any} where {M<:ReactiveModel}
for field in fieldnames(typeof(app))
f = getfield(app, field)

field != :channel__ && occursin(SETTINGS.private_pattern, String(field)) && continue
occursin(SETTINGS.private_pattern, String(field)) && continue
f isa Reactive && f.r_mode == PRIVATE && continue

result[field] = Stipple.jsrender(f, field)
Expand Down

0 comments on commit 9b3c9d4

Please sign in to comment.