Stage-3 method decorator. It ensures a method in a class is called only once per instance. Subsequent calls will be canceled and log a warning. Works for instance or static methods.
class A { @callOnce init() { ... } } Copy
class A { @callOnce init() { ... } }
Description
Stage-3 method decorator. It ensures a method in a class is called only once per instance. Subsequent calls will be canceled and log a warning. Works for instance or static methods.
Example