0.8.22 • Published 27 days ago

@fnet/inter-service-js v0.8.22

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
27 days ago

@fnet/inter-service-js

@fnet/inter-service-js is a JavaScript-based library that serves as a tool for enabling inter-service communication within the browser's window context. It establishes a system through which distinct JavaScript services running in the same browser context can connect, communicate, and share data using message posting and event-driven patterns.

Functionality

The tool provides a set of methods that allow JavaScript services to:

Connect

Services can connect with each other by specifying the target window (i.e., the window context of another service) and an ID to identify itself. This connection promotes inter-service communication.

Find Router

Services can find sibling or parent routers within the window hierarchy. It traverses up the window context to find a router and can return the first router it encounters.

Register & Unregister

Services can register and unregister handlers. Registered handlers are unique methods associated with a service. Once registered, these methods become available for other services to use through the use of proxies.

Proxy Communication

A service can use a proxy to forward calls to other services. It passes the method name, service ID, and the arguments to be used by the target method in the target service.

Message Handling

The tool handles incoming messages based on their type. It distinguishes between connection requests, forward requests, direct service handler calls, and transaction response messages.

Event Emission

Using an event emitter, it can attach listeners to specific events, emit events, and manage event listeners.

Importance

Inter-service communication in the context of a web browser is a critical feature, allowing complex applications to break down into specific, isolated services. These services can function independently, reducing complexities and improving the modularity and maintainability of applications.

@fnet/inter-service-js provides a robust and efficient solution to manage and streamline these inter-service communications using modern JavaScript features and Event emitters. It allows developers to keep different parts of an application decoupled, enhancing the development and debugging process on a large scale.

0.8.22

27 days ago

0.8.21

27 days ago

0.8.20

27 days ago

0.8.19

27 days ago

0.8.16

27 days ago

0.8.15

27 days ago

0.8.18

27 days ago

0.8.17

27 days ago

0.8.14

28 days ago

0.8.13

1 month ago

0.8.12

1 month ago

0.8.11

1 month ago

0.8.10

1 month ago

0.8.9

1 month ago

0.8.8

1 month ago

0.8.7

2 months ago

0.8.6

2 months ago

0.8.5

2 months ago

0.8.4

3 months ago

0.8.3

3 months ago

0.8.2

3 months ago

0.8.1

7 months ago

0.7.4

7 months ago

0.7.3

7 months ago

0.7.2

7 months ago

0.7.1

7 months ago

0.6.2

7 months ago

0.6.1

7 months ago

0.5.7

7 months ago

0.5.6

7 months ago

0.5.5

7 months ago

0.5.4

7 months ago

0.5.3

7 months ago

0.5.2

7 months ago

0.5.1

7 months ago