This message was deleted.
# compose
s
This message was deleted.
s
Compose just invalidates everything inside that group (see
providersInvalid
flag in
Composer
)
Skipping is done by the compiler
Yes, but logic is encoded by the compiler, I recommend looking into decompiled bytecode (e.g with jadx)
don't use ide, it barely knows what bytecode your own code is producing, use external decompilers
c
As @shikasd points out, there is code generated by the compiler that checks whether or not a function should be skipped. It includes checking parameter values and the current composer's
skipping
state. If
skipping
is
false
the function will not be skipped regardless of which parameters are passed to it. When a static composition local is changed then
skipping
will return
false
for all children of the
CompositionLocalProvider
call. The recompose states are not invalidated as there is no need to. They will execute regardless as skipping is disabled until
CompositionLocalProvider
returns (technically, until
endProvider()
is called).
Yes, every skippable composable function checks
shouldExecuted
to determine whether it should execute its content or skip. Non-skippable functions (e.g. inline composable functions or function explicitly marked non-skippable with
@NonSkippableComposable
) do not; they never skip. Changing the value of a static composition local will cause the map storing the composition locals to change. When the map changes
providersInvalid
is set to
true
until the corresponding
end
is called (i.e. the function returns). While
providersInvalid
is
true
shouldExecute
will return
true
. This means that changing the value of a static composition local is possible but is costly. The intent is that static composition locals never (or nearly never) change. However, if a value changes rarely then using a static local may be less costly overall than a dynamic local as the cost of tracking reads of a dynamic local has a cost too which statics do not pay.
s
It does not apply to lambdas
Probably, file a bug please