Example Setup
This example is split into two parts, the ./host.js
and the ./client.js
.
However it is possible to use Echo-D in other network topologies.
It is important to prevent the flow of data from the various nodes to not cycle
around or else it will create an infinite loop.
To prevent this, it is recommended to use the mask
option in the updater
method
as well as the other options in the EchoD
constructor.
Events
Uses EventEmitter
from node:events
to create an events
object.
This can be bundled for use in browsers with a bundler such as
esbuild
, webpack
, bun build
, or another bundler.
Here is an example of barebones events
implementation.
It is recommended to use a library such as mitt
for handling events.
However this illustrates that Echo-D only uses on
and emit
methods.