Add callback to allow Static IP per SSID in WiFiMulti by Sojourneer · Pull Request #9232 · esp8266/Arduino
Meaning, there are other use-cases besides config() call?
In my use-case, I am setting the config parameters based on the MAC address (because of various router issues). Yes, that could be done upfront rather than when the SSID is decided.
But it seems cleaner, as well as more efficient, to have the config calculated when needed rather than preemptively. I have a library that takes a JSON config (IP, as well as optionally MQTT etc.) and applies it in the callback to call config per the found SSID. Again, decoupling that from the code for the physical connection is beneficial.