mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-12 02:41:42 +08:00
批量更新数据
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<pre>
|
||||
<strong>Input:</strong>
|
||||
actions = ["EventEmitter", "emit", "subscribe", "subscribe", "emit"],
|
||||
values = [[], ["firstEvent", "function cb1() { return 5; }"], ["firstEvent", "function cb1() { return 6; }"], ["firstEvent"]]
|
||||
values = [[], ["firstEvent"], ["firstEvent", "function cb1() { return 5; }"], ["firstEvent", "function cb1() { return 6; }"], ["firstEvent"]]
|
||||
<strong>Output:</strong> [[],["emitted",[]],["subscribed"],["subscribed"],["emitted",[5,6]]]
|
||||
<strong>Explanation:</strong>
|
||||
const emitter = new EventEmitter();
|
||||
@@ -61,7 +61,7 @@ emitter.emit("firstEvent", [4, 5, 6]); // [], there are no subscriptio
|
||||
<strong>Input:</strong>
|
||||
actions = ["EventEmitter", "subscribe", "subscribe", "unsubscribe", "emit"],
|
||||
values = [[], ["firstEvent", "x => x + 1"], ["firstEvent", "x => x + 2"], [0], ["firstEvent", [5]]]
|
||||
<strong>Output:</strong> [[],["subscribed"],["emitted",["1,2,3"]],["unsubscribed",0],["emitted",[7]]]
|
||||
<strong>Output:</strong> [[],["subscribed"],["subscribed"],["unsubscribed",0],["emitted",[7]]]
|
||||
<strong>Explanation:</strong>
|
||||
const emitter = new EventEmitter();
|
||||
const sub1 = emitter.subscribe("firstEvent", x => x + 1);
|
||||
|
Reference in New Issue
Block a user