-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Additions to the .rx namespace #906
Conversation
Thanks. Not sure how we missed some of those earlier. The doc page also needs updating. |
I did not fully appreciate that |
Why are the underscores needed? |
Python keywords cannot be identifiers. |
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.
Looks good to me now, thanks!
Co-authored-by: James A. Bednar <jbednar@continuum.io>
"id": "7eac3901-b9e6-4020-8f74-5817561a187e", | ||
"metadata": {}, | ||
"source": [ | ||
"When we update the expression the `updating` expression will temporarily toggle to True and then reset:" |
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 there a way to hook into this updating
? An example of this could be adding a loading spinner in Panel if more than 1 second has passed?
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.
Quite difficult since most of the time whatever action that is performing the update will be blocking which means you can't simultaneously perform throttling or debouncing on the event.
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.
Ok.
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.
Looking into it, since now I want this.
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.
Will only work for async callbacks and generators though.
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 think the API doc (https://github.com/holoviz/param/blob/main/doc/reference/param/reactive.md) needs to be updated.
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.
Other than Maxime suggestion LGTM.
As we have started building applications with
rx
a few gaps have become clear, specifically the following functionality is currently missing:rx()
which initializes with a None valuenot
keyword, therefore we introduce.rx.not_
.rx.map
and
keyword, therefore we introduce.rx.and_
or
keyword, therefore we introduce.rx.or_
initial
value on.param.when
so that the expression isn't evaluated until the first event is triggered.rx.watch()
without args to make expression evaluate eagerly