Ver Fonte

docs: publicEmit comments

Sv443 há 5 meses atrás
pai
commit
0c989853e6
1 ficheiros alterados com 2 adições e 0 exclusões
  1. 2 0
      README.md

+ 2 - 0
README.md

@@ -1600,6 +1600,7 @@ myInstance.on("foo", (bar) => {
   console.log("foo event (outside):", bar);
 });
 
+// only works if publicEmit is set to true
 myInstance.emit("baz", "hello from the outside");
 
 myInstance.unsubscribeAll();
@@ -1633,6 +1634,7 @@ myEmitter.once("baz", (qux) => {
 });
 
 function doStuff() {
+  // only works if publicEmit is set to true
   myEmitter.emit("foo", "hello");
   myEmitter.emit("baz", 42);
   myEmitter.emit("foo", "world");