-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Effects not firing in response to reactive list #22
Comments
Is this perhaps related to #5 and it's the In my real example, I have some logging occurring, which would have much the same effect. |
What's the actual function? Typically if you want to react to the whole list you have to operate on the list. |
Fair enough! Here's the actual function: @render_effect
def refresh_tabulator(self):
# I'm not sure why I need to use len here but it doesn't work
# with just a simple assignment. There has to be some sort of
# op on the signal in order for the function to fire.
_signal = len(self.store.changelog) # noqa unused_variable
self.logger.debug("ReactivePersistenceTabulator: Refreshing tabulator")
if not self.store or not self.store.view:
self.logger.debug("ReactivePersistenceTabulator: Store is empty. Bailing out.")
return
if self.tabulator is None:
self.logger.debug("ReactivePersistenceTabulator: No tabulator exists yet. Building it...")
self.build_tabulator()
return
self.tabulator.deselect_row()
self.tabulator.clear_app_table_cache()
self.tabulator.set_data()
I suppose I could just use a counter that I increment any time a relevant event occurs. |
yeah - so just appending doesn't change the list An incrementing counter will do the same job |
gotcha! No, nothing else is reading from there. It's purely a signal. |
closing this issue for now |
When using a
reactive_list
, I'm finding that using a simple assignment in an effect does not cause it to fire when the list changes (except for the first change). Instead, I have to do some operation on it.e.g.
gives
Clone link for this example code: https://anvil.works/build#clone:3QI3BEYGOXNH2RGK=PINMJMBUL5U4O5NWS6CSAKDA
The text was updated successfully, but these errors were encountered: