-
Hi. I’m trying to modularize my code but reactivity breaks. What could i be doing wrong?
|
Beta Was this translation helpful? Give feedback.
Answered by
mbostock
Nov 27, 2024
Replies: 1 comment 3 replies
-
Reactivity is only available as top-level variables in pages. It does not apply within modules, though you can define a generator function in a module, and then use it to declare a reactive top-level variable on a page. https://observablehq.com/framework/reactivity#top-level-variables |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
Ombuweb
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reactivity is only available as top-level variables in pages. It does not apply within modules, though you can define a generator function in a module, and then use it to declare a reactive top-level variable on a page.
https://observablehq.com/framework/reactivity#top-level-variables