8000 fixed the state/listener system, added more granular examples (and ad… · joshbrew/graphscript@3c74a06 · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit 3c74a06

Browse files
committed
fixed the state/listener system, added more granular examples (and adding more)
1 parent 087620a commit 3c74a06

File tree

128 files changed

+1087
-678
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+1087
-678
lines changed

___package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "graphscript-core",
3-
"version": "0.2.78",
3+
"version": "0.2.79",
44
"description": "Comprehensive acyclic-graph based application architecture with microservices and networking.",
55
"main": "dist/index.core.js",
66
"module": "dist/index.core.esm.js",

__package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "graphscript-node",
3-
"version": "0.2.78",
3+
"version": "0.2.79",
44
"description": "Comprehensive acyclic-graph based application architecture with microservices and networking",
55
"main": "dist/index.node.js",
66
"types": "dist/index.node.d.ts",

dist/index.core.esm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.core.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.esm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.node.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/src/core/Graph.d.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { EventHandler } from "./EventHandler";
22
export declare const state: EventHandler;
33
export type GraphNodeProperties = {
4-
__props?: Function | GraphNodeProperties;
4+
__props?: Function | {
5+
[key: string]: any;
6+
} | GraphNodeProperties | GraphNode;
57
__operator?: ((...args: any[]) => any) | string;
68
__children?: {
7-
[key: string]: GraphNodeProperties;
9+
[key: string]: any;
810
};
911
__listeners?: {
1012
[key: string]: true | string | ((result: any) => void) | {
@@ -26,10 +28,11 @@ export type GraphNodeProperties = {
2628
[key: string]: any;
2729
};
2830
export type Loader = (node: GraphNode, parent: Graph | GraphNode, graph: Graph, roots: any, properties: GraphNodeProperties, key: string) => void;
31+
export type Roots = {
32+
[key: string]: any;
33+
};
2934
export type GraphOptions = {
30-
roots?: {
31-
[key: string]: any;
32-
};
35+
roots?: Roots;
3336
loaders?: {
3437
[key: string]: Loader | {
3538
init?: Loader;
@@ -111,7 +114,7 @@ export declare class Graph {
111114
set: (tag: string, node: GraphNode) => Map<string, any>;
112115
delete: (tag: string) => boolean;
113116
getProps: (node: GraphNode | string, getInitial?: boolean) => void;
114-
subscribe: (nodeEvent: GraphNode | string, onEvent: string | GraphNode | ((...res: any) => void), args?: any[], key?: string | undefined, subInput?: boolean, target?: string | GraphNode, bound?: string) => any;
117+
subscribe: (nodeEvent: GraphNode | string, onEvent: string | GraphNode | ((...res: any) => void), args?: any[], key?: string | undefined, subInput?: boolean, target?: string | GraphNode, bound?: string) => number;
115118
unsubscribe: (node: GraphNode | string, sub?: number, key?: string, subInput?: boolean) => any;
116119
setState: (update: {
117120
[key: string]: any;

dist/src/services/Service.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export declare class Service extends Graph {
2727
handleGraphNodeCall(route: string | GraphNode, args: any): any;
2828
transmit: (...args: any[]) => any | void;
2929
receive: (...args: any[]) => any | void;
30-
pipe: (source: GraphNode | string, destination: string, endpoint?: string | any, method?: string, callback?: (res: any) => any | void) => any;
30+
pipe: (source: GraphNode | string, destination: string, endpoint?: string | any, method?: string, callback?: (res: any) => any | void) => number;
3131
pipeOnce: (source: GraphNode | string, destination: string, endpoint?: string | any, method?: string, callback?: (res: any) => any | void) => void;
3232
terminate: (...args: any) => void;
3333
isTypedArray: typeof isTypedArray;

dist/src/services/cmd/CMD.node.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ export declare class CMDService extends Service {
5050
send: (childprocess: ChildProcess, data: Serializable) => boolean;
5151
request: (message: ServiceMessage | any, processId: string, method?: string) => Promise<unknown>;
5252
runRequest: (message: any, callbackId: string | number, childprocess?: ChildProcess | string) => any;
53-
subscribeProcess(route: string, childprocess: ChildProcess | string, args?: any[], key?: string, subInput?: boolean): any;
53+
subscribeProcess(route: string, childprocess: ChildProcess | string, args?: any[], key?: string, subInput?: boolean): number;
5454
subscribeToProcess(route: string, processId: string, callback?: ((res: any) => void) | string, args?: any[], key?: string, subInput?: boolean): any;
5555
}

0 commit comments

Comments
 (0)
0