Skip to content

Commit 1189b77

Browse files
committed
Convert structure to Node.js
1 parent 45fad54 commit 1189b77

File tree

6 files changed

+15
-41
lines changed

6 files changed

+15
-41
lines changed

index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
import { subscribe, publish } from "./src/Event.js";
2-
import { useEvent } from "./src/useEvent.js";
32

4-
export { subscribe, publish, useEvent };
3+
export { subscribe, publish };

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "@nucleoidai/react-event",
3-
"version": "1.1.9",
2+
"name": "@nucleoidai/event-event",
3+
"version": "0.0.0",
44
"type": "module",
5-
"description": "Event-driven alternative to React Context",
5+
"description": "Event-driven Message Broker",
66
"main": "index.js",
7-
"homepage": "https://nucleoid.com",
7+
"homepage": "https://nucleoid.ai",
88
"license": "Apache-2.0",
99
"keywords": [
1010
"react-event",
@@ -29,9 +29,9 @@
2929
},
3030
"repository": {
3131
"type": "git",
32-
"url": "git+https://github.com/NucleoidAI/react-event.git"
32+
"url": "git+https://github.com/NucleoidAI/node-event.git"
3333
},
3434
"bugs": {
35-
"url": "https://github.com/NucleoidAI/react-event/issues"
35+
"url": "https://github.com/NucleoidAI/node-event/issues"
3636
}
3737
}

src/Event.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const subscribe = (...args) => {
3939
const type = args.join(".");
4040
const id = uuid();
4141

42-
console.debug("react-event", "subscribe", type, id);
42+
console.debug("node-event", "subscribe", type, id);
4343

4444
if (type === '__proto__' || type === 'constructor' || type === 'prototype') {
4545
throw new Error("Invalid subscription type");
@@ -53,7 +53,7 @@ const subscribe = (...args) => {
5353
type,
5454
callback,
5555
unsubscribe: () => {
56-
console.debug("react-event", "unsubscribe", type, id);
56+
console.debug("node-event", "unsubscribe", type, id);
5757
delete subscriptions[type][id];
5858

5959
if (Object.keys(subscriptions[type]).length === 0) {
@@ -81,7 +81,7 @@ const publish = (...args) => {
8181
const payload = args.pop();
8282
const type = args.join(".");
8383

84-
console.log("react-event", "publish", type, payload);
84+
console.log("node-event", "publish", type, payload);
8585
messages.set(type, payload);
8686

8787
if (type === '__proto__' || type === 'constructor' || type === 'prototype') {

src/test/event.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { subscribe, publish, messages } from "../Event.js";
22

3-
describe("react-event", () => {
3+
describe("node-event", () => {
44
it("accepts type and payload", () => {
55
expect(() => publish("TEST_EVENT")).toThrow();
66
});

src/useEvent.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)