@lijuhong1981/jsevents 1.2.12 → 1.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +15 -0
- package/README.md +22 -11
- package/package.json +5 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022-2026 lijuhong1981
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
# @lijuhong1981/jsevents
|
|
2
|
+
|
|
3
|
+
> 事件系统,提供 `EventDispatcher`(事件分发)、`EventEmitter`(发布/订阅)与 `EventSubscriber`(事件封装),均支持 `Destroyable` 销毁。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @lijuhong1981/jsevents
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 导出
|
|
12
|
+
|
|
13
|
+
- `EventDispatcher` — 事件分发管理器(`addEventListener`/`removeEventListener`/`dispatch`/`dispatchEvent` 等)
|
|
14
|
+
- `EventEmitter` — 发布/订阅模式
|
|
15
|
+
- `EventSubscriber` — 单类型事件的监听器封装
|
|
16
|
+
|
|
17
|
+
监听选项 `options`:
|
|
18
|
+
|
|
19
|
+
| 项 | 说明 |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| `scope` | 回调函数的 `this` 指针对象 |
|
|
22
|
+
| `once` | 是否单次事件(触发后自动移除) |
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lijuhong1981/jsevents",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.2.13",
|
|
4
|
+
"description": "Event system with EventDispatcher, EventEmitter and EventSubscriber.",
|
|
5
5
|
"author": "lijuhong1981 <lijuhong@hotmail.com>",
|
|
6
6
|
"homepage": "https://github.com/lijuhong1981/jslibs#readme",
|
|
7
7
|
"license": "ISC",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"url": "https://github.com/lijuhong1981/jslibs/issues"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@lijuhong1981/jscheck": "^1.1.
|
|
23
|
-
"@lijuhong1981/jsdestroy": "^1.2.
|
|
22
|
+
"@lijuhong1981/jscheck": "^1.1.7",
|
|
23
|
+
"@lijuhong1981/jsdestroy": "^1.2.7"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "e968d936633601ce59f5c9aa99c36143b66a1de2"
|
|
26
26
|
}
|