How do you deal with multiple Hooks for multiple liveview pages?

The sample phoenix app created with liveview, sets up a livesocket in the app.js. How do you deal with hooks if you have 20 liveview pages that need hooks?

  • Should I import 20 hooks into app.js so only the ones present (phx-hook present) will be used?
  • Should I create 20 entry points in the webpack config file?

Any hints are welcome :slight_smile:

Export them from a shared file and reference them when you create the LiveSocket

1 Like

Iā€™m doing that right now. It seems the simplest solution