Light library for data propagation
Synapses provides a light reactive communication system based on observables instances called Emitter, which allow the notification and asynchronous exchange of information packets within a webapp, and provide a series of tools to filter, manipulate and forward them to other instances observable or other subjects.
Processing information creates a chain of observable nodes that you can subscribe to.
The library is also available of some methods for monitoring and obtaining information from various channels and data sources that a webapp can draw on, including:
- Interval
- DOM events
- Change of cookie value 🍪
- Change of (local/session)storage item value
- Change parameter query string
- Receiving WebSocket messages
- HTTP fetch polling
- Custom value watchers
/// import specific methods or classes
import { Emitter, fromListener } from "synapses";
// ...
// or entire library
import * as synapses from "synapses";
// ...
<script type="module">
/// import specific methods or classes
import { Emitter, fromListener } from "./synapses/esm/index.js";
// ...
// or entire library
import * as synapses from "./synapses/esm/index.js";
// ...
</script>
/// import specific methods or classes
const { Emitter, fromListener } = require("synapses");
// ...
// or entire library
const synapses = require("synapses");
// ...
Documentation with examples can be found clicking here
This package is written in TypeScript and the build includes type definitions for use in other TypeScript projects.
The build of this package generates two versions:
- ES Module: For use in TypeScript or web projects for browsers that support ES6 modules. Using ES6 import in projects based on node.js (including TypeScript) it allows during the bundling phase (via webpack, rollup or equivalent) to perform the tree-shaking of the dependencies and have a lighter bundle.
- Universal Module Definition: To be used directly in projects based on node.js, or into web projects callable via global variable or via requirejs
master | develop |
---|---|