Syntax Lookup
Enter some language construct you want to know more about.
@live / @@live
These decorators mark code as live for dead-code analysis.
@live tells reanalyze's dead code analysis that the value should be considered live, even though it might appear to be dead. This is typically used in case of FFI where there are indirect ways to access values.
It can be added to everything that could otherwise be considered unused by the dead code analysis - values, functions, arguments, records, individual record fields, and so on.
Since ReScript 12.2, standalone @@live marks all following items in the current file or module as live roots until another scoped annotation overrides it:
RESmodule PublicApi = {
@@live
let load = () => "loaded"
let save = _value => ()
}