Skip to content

Function: save() ​

save<T>(key, data): boolean

Defined in: save.ts:23

Saves data locally.

Type Parameters ​

T ​

T

Parameters ​

key ​

string

The key for retrieving the saved data.

data ​

T

The data to save.

Returns ​

boolean

Returns true if the data was saved successfully, false if the storage quota was exceeded.

Example ​

ts
const playerState = {
 name: 'MagicPoney',
 score: 12500
}
facile.save('player', playerState);