Once.hx 346 B

123456789101112131415161718
  1. package eval.luv;
  2. /**
  3. Once-only initialization.
  4. @see https://aantron.github.io/luv/luv/Luv/Once
  5. **/
  6. @:coreType abstract Once {
  7. /**
  8. Allocates and initializes a once-only barrier.
  9. **/
  10. static public function init():Result<Once>;
  11. /**
  12. Guards the given callback to be called only once.
  13. **/
  14. public function once(callback:()->Void):Void;
  15. }