buildKey(key)
Builds a key.
Arguments
key(string): String to build a key of.
Lifecycle
preBuildKey
Event name:
preBuiltKeyProperties passed:cacheInstancereference to cache instance (this)keykey passed tobuildKeymethod
Returns: (object): object containing properties:
cacheInstancereference to cache instance (this)keykey passed through handlers added forpreBuildKeyevent
postBuildKey
Event name:
postBuiltKeyProperties passed:cacheInstancereference to cache instance (this) returned bypreBuildKeykeykey built by adapter using its buildKey method
Returns: (object): object containing properties:
cacheInstancereference to cache instance (this)keykey passed through handlers added forpostBuildKeyevent
Eventually
buildKeyreturns key returned bypostBuildKey.
Returns
(string): Built key. Depends on adapter being used.
Example
// assuming that you already have cache instance prepared
const builtKey = cache.buildKey('key');Last updated