@mobilizing/soundworks-plugin-persistent-state
v2.0.0
Published
soundworks service for auto saving and loading schema data
Downloads
8
Readme
soundworks | plugin persistent state
soundworks plugin for persisting schema data.
Mostly useful for configuration schemas.
Table of Contents
Installation
npm install @mobilizing/soundworks-plugin-persistent-state --saveUsage
Server installation
Registering the plugin
// server/index.js
import { Server } from "@soundworks/core/server";
import pluginPersistantStates from "@mobilizing/soundworks-plugin-persistent-state/server.js";
import configSchema from "./schemas/config.js";
const configSchemaName = "config";
const server = new Server();
server.pluginManager.register("persistant-states", pluginPersistantStates, {
schemaNames: [configSchemaName],
dir: "./.data",
});
server.stateManager.registerSchema(configSchemaName, configSchema);Credits
This code has been written thanks to fundings from PSL Valorisation for the MobColl prematuration project program and the CPCFQ cooperation funds.
