re-frame

steveb8n 2026-01-04T02:20:24.982509Z

What is the benefit of bypassing the caching behavior of subscriptions when subscribing to a flow?

steveb8n 2026-01-04T02:54:42.546879Z

I presume that it means that the component will only render when a flow is recalculated. It's not super obvious from the flow docs.

Kimo 2026-01-04T03:07:19.454509Z

Sorry, that answer didn't really explain it, let me think...

🙏 1
Kimo 2026-01-04T03:52:23.968519Z

Calling (subscribe [:flow {:id 1}]) does give you a reagent/reaction, which is also how a regular subscription works. Under the hood, reagent does some caching, to make sure your component only renders when that reaction's value changes. But regular subscriptions have extra machinery to handle creation-on-demand, lifecycle management, deduplication, derived values, etc... These can be hard to understand and control. The idea of flows is that you define all that behavior explicitly. A flow "caches" its value by storing it in app-db. You control when that value can change, and when it gets cleaned up, using :live, :inputs and :cleanup.

Kimo 2026-01-04T03:53:46.196049Z

You might find more of an answer in the advanced doc - https://day8.github.io/re-frame/flows-advanced-topics/#caching

steveb8n 2026-01-04T04:47:47.035689Z

Thanks I'll reread the caching section.