registerPlugins(plugins)
Registers plugins and returns new instance of self (cacheInstance) extended with functionalities provided by plugins.
Arguments
plugins
(array): Array of plugins.
Returns
(cacheInstance): A new instance of cacheInstance. New instance of cache, like the original one, is immutable (using Object.freeze).
Throws
When plugins are not passed as an array.
When any of the plugins won't contain either
hooks
orcreateExtensions
method.When any of the plugins will try do add a method that already exists (which would overwrite it).
Example
Last updated