get

Get the value, remove the date if expired

get(key)

Parameters

key
{string} name of the key you want to read

Return

This method return the value of a data (string, int, float, array, object...)

Exemples

OhMyCache.Local.set('key', 'value')

OhMyCache.Local.get('key') // 'value'

OhMyCache.Session.get('key') // null


OhMyCache.Local.set('key', 'value', {expire: 1})
// sleep 2 secondes or more

OhMyCache.Local.get('key') // null