0.2.3 • Published 7 months ago
@graffiti-garden/wrapper-synchronize v0.2.3
Graffiti Synchronize
This library wraps the Graffiti API so that changes made or received in one part of an application are automatically routed to other parts of the application. This is an important tool for building responsive and consistent user interfaces, and is built upon to make the Graffiti Vue Plugin and possibly other front-end libraries in the future.
Installation
In node.js, simply install the package with npm:
npm install @graffiti-garden/wrapper-synchronize
In the browser, you can use a CDN like jsDelivr. Add an import map the the <head>
of your HTML file:
<head>
<script type="importmap">
{
"imports": {
"@graffiti-garden/wrapper-synchronize": "https://cdn.jsdelivr.net/npm/@graffiti-garden/wrapper-synchronize/dist/index.browser.js"
}
}
</script>
</head>
In either case, you can then import and contruct the class as follows:
import { GraffitiSynchronize } from "@graffiti-garden/wrapper-syncronize";
const graffiti = new GraffitiLocal() // or any other implementation of the Graffiti API
const graffitiSynchronized = new GraffitiSynchronize(graffiti)