bootstrapFlatMap

fun <T, R> Provider<T>.bootstrapFlatMap(transform: (T) -> Provider<R>): Provider<R>

Flat-maps the value of this provider via transform. During bootstrap phase, uses Provider.flatMap, otherwise Provider.immediateFlatMap. This allows creating flat-mapped providers based off of RegistryEntries lazily during bootstrap phase, where resolving their value is not possible, without paying for the extra overhead post-bootstrap, where immediateFlatMap can be used.

The idea behind this is that for non-reloadable registries, immediateFlatMap basically just calls transform(get()), so no intemediate flat-mapping provider needs to be created. For reloadable registries, the difference behind flatMap and immediateFlatMap should be negligible.