3 ms·
Ports is explicitly async and therefore only viable for a significantly limited subset of purposes. This has been discussed at length elsewhere in this thread,
by mst 4y ago
Ports is explicitly async and therefore only viable for a significantly limited subset of purposes.
This has been discussed at length elsewhere in this thread, on elm related discussion boards, and in multiple articles.
Ports is the -preferred- way to interface with javascript, certainly, and when its inherent limitations aren't a deal breaker, its being preferred is entirely sensible.
It is not, however, an escape hatch in any meaningful way, hence why people were extremely upset when the actual escape hatch was disabled by maintainer fiat.
- mejutoco 4y agoI guess I am less strict with what I consider an escape hatch. It does not need to be optimal or follow my preferred method IMHO. Other than performance I do not see any limitation of the async port system. You can call back from the js side. It is an especial way, I agree, but one that keeps the Elm paradigm intact. It is quite clever. It is "different", but I do not consider that a limitation, but a matter of preference.