Class: Cache

Cache

new Cache()

缓存类

Example
const cache = new Hilo3d.Cache();
cache.add('id1', {a:1});
cache.get('id1');
cache.remove('id1');

Methods Show Inherited

get(id){Object}

获取对象

Name Type Description
id String
Returns:
Type Description
Object

getObject(obj){Object}

获取对象

Name Type Description
obj Object
Returns:
Type Description
Object [description]

add(id, obj)

增加对象

Name Type Description
id String
obj Object

remove(id)

移除对象

Name Type Description
id String

removeObject(obj)

移除对象

Name Type Description
obj Object

removeAll()

移除所有对象

each(callback)

遍历所有缓存

Name Type Description
callback function