API Docs for: 0.0.2
Show:

Atlantis.StorageManager Class

Module: Engine
Parent Module: Atlantis

A storage manager that work with localStorage

Constructor

Atlantis.StorageManager

()

Item Index

Methods

getLoadStorageKey

(
  • name
)
String

Gets the localStorage key with a container name and a data name.

Parameters:

  • name String

    Desired name for the data who'll save.

Returns:

String:

The localStorage final key.

load

(
  • name
  • defaultValue
)
Object

Load data from the localStorage.

Parameters:

  • name String

    The data key.

  • defaultValue Object

    The default value if the data not exists.

Returns:

Object:

The object if exists otherwise return defaultValue

save

(
  • container
  • name
  • or
)

Save data in the localStorage.

Parameters:

  • container String

    The localStorage key.

  • name String

    Desired name for the data who'll save.

  • or Object

    {String} data An object to serialize or a serialized object.