-
Notifications
You must be signed in to change notification settings - Fork 117
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
Add the lens
component
#587
Conversation
Co-Authored-By: Kaur Kuut <[email protected]>
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.
Quality code as usual. Nice job on the docs.
# The default clippy value for this is 250, which causes warnings for rather simple types | ||
# like Box<dyn Fn(&mut Env, &T)>, which seems overly strict. The new value of 400 is | ||
# a simple guess. It might be worth lowering this, or using the default, in the future. | ||
type-complexity-threshold = 400 |
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.
👍
child: V, | ||
phantom: PhantomData<fn() -> (ParentState, ChildState)>, | ||
phantom: PhantomData<fn(ParentState) -> (ChildState, Action, Context, Message)>, |
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.
Good catch, has this kind caused issues already in practice?
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.
I don't think so, but I could foresee it being troublesome for the tests.
It might have been fine.
I will add a comment that the variance consequences of this have not been reasoned about.
/// # struct AppData; | ||
/// fn log_lifecycle(data: &mut AppData) -> impl PhantomView<AppData, (), ViewCtx> { | ||
/// fn log_lifecycle(data: &mut AppData) -> impl WidgetView<AppData, ()> { |
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.
I just noticed this (+docs.rs
), nice trick.
Co-authored-by: Philipp Mildenberger <[email protected]>
See https://xi.zulipchat.com/#narrow/stream/354396-xilem/topic/Lens.20View
Usage:
Also extends the docs features in Xilem Core, and increases the complexity threshold