Sometimes, a good interface will allow the user to make a variety of changes and save modifications without having to click on a save button. The Autosave functionality will save modifications only when the object being watched has changed. The differentiation is based on the toJSON return value, as it’s the value actually being sent to the server (other property won’t be saved anyway). The watcher checks for changes every 500 ms.

import { Autosave } from ‘entcore-toolkit’;

// Watching an object‘/path/to/save’, myObj);
// Using a callback instead of a path =>, myObj);
// Stop watching
// Stop all watchers

results matching ""

    No results matching ""