// using node-localstorage as an example
import { LocalStorage } from "node-localstorage";
const ls = new LocalStorage("/");
const numbers = new Variable<number[]>("numbers", [1, 2], ls);
// Setting the values
numbers.set([]);
numbers.set([3, 4], "domain");
// Getting the values
numbers.get(); // []
numbers.get("domain"); // [3, 4]
// Resetting the values back to the default values
numbers.clear();
numbers.clear("domain");
// Getting the default values
numbers.get(); // [1, 2]
numbers.get("domain"); // [1, 2]-
Notifications
You must be signed in to change notification settings - Fork 0
filiptypjeu/npm-persistance
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.