Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If I want to use Platform.Sub.map, do I have to import it?

Tags:

elm

There is no mention of this here.

When I tried, it said Module Platform does not expose Sub

like image 436
Ashnur Avatar asked Dec 06 '25 08:12

Ashnur


1 Answers

Platform.Sub and Platform.Cmd are imported by default as Sub and Cmd, so you need to omit the Platform.-part.

It's also worth noting that Platform, Platform.Sub, and Platform.Cmd are all different modules, that is, if they weren't imported by default and you just imported Platform, you still couldn't access Sub and Cmd with the Platform. prefix. This is more apparent if you look at the source for the core package (specifically Platform.elm and Platform/).

like image 173
ahstro Avatar answered Dec 10 '25 13:12

ahstro



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!