Skip to content
This repository was archived by the owner on Sep 7, 2025. It is now read-only.

Programming interface

Cédric Belin edited this page Apr 7, 2022 · 2 revisions

This library provides the Storage class, dedicated to the Web Storage access.

import webstorage.Storage;

function main() {
  final localStorage = Storage.local();

  localStorage.set("foo", "bar");
  trace(localStorage.get("foo")); // "bar"

  localStorage.setObject("foo", {baz: "qux"});
  trace(localStorage.getObject("foo")); // {baz: "qux"}
}

The Storage class provides two entry static methods:

  • local(): returns a wrapper around the local storage.
  • session(): returns a wrapper around the session storage.

The returned instance has the following API:
TODO

Clone this wiki locally