-
-
Notifications
You must be signed in to change notification settings - Fork 42
Callback context #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Callback context #46
Conversation
@@ -28,7 +28,7 @@ jobs: | |||
- run: | |||
name: 🔎 Unit tests | |||
command: | | |||
julia -e 'using Pkg; Pkg.update(); Pkg.add(PackageSpec(url="https://github.com/plotly/Dash.jl.git", rev=ENV["CIRCLE_BRANCH"])); Pkg.add(PackageSpec(url="https://github.com/waralex/dash-html-components.git", rev="jl_generator_test")); Pkg.add(PackageSpec(url="https://github.com/waralex/dash-core-components.git", rev="jl_generator_test")); Pkg.build("Dash"); Pkg.build("DashHtmlComponents"); Pkg.build("DashCoreComponents"); Pkg.test("Dash", coverage=true); function precompile_pkgs(); for pkg in collect(keys(Pkg.installed())); if !isdefined(Symbol(pkg), :Symbol) && pkg != "Compat.jl"; @info("Importing $(pkg)..."); try (@eval import $(Symbol(pkg))) catch end; end; end; end; precompile_pkgs()' | |||
julia test/ci_prepare.jl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😎 🍹 Much nicer, thanks!
src/handler/callback_context.jl
Outdated
outputs_list::Vector{Any} | ||
inputs_list::Vector{Any} | ||
states_list::Vector{Any} | ||
triggered::Union{Nothing, Vector{TriggeredParam}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the Nothing
necessary? Won't triggered
at least be a length-0 Vector? Just trying to make sure this is as easy to use as possible, so users don't need fallback code for the Nothing
case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexcjohnson I agree, I'll fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexcjohnson fixed at eb51d4b
src/handlers.jl
Outdated
include("handler/router.jl") | ||
include("handler/base.jl") | ||
#include("handler/router.jl") | ||
#include("handler/base.jl") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
obsolete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexcjohnson fixed at eb51d4b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic - just two minor comments, but the code & tests all look great. 💃
Added the
callback_context()
function. This function only works from callback processing functions and returns a CallbackContext object :In addition, I refactored the code structure - distributed independent parts of the code to different files, designed the routing-related functionality as a sub-module, and so on. Therefore, the number of changed files in PR turned out to be significant, but for the most part it is copying code from old files to new ones.