getPostData(methodName, args)
Returns `post` (in terms of lifecycle of given method) data which is passed through all of the hooks registered for that particular method.
This method is not available directly (e.g. while importing stuff from stash-it), but it is passed as one of the properties in object for createExtensions method in plugins.
Arguments
methodName
(string): method name, any one of the adapter's API (e.g.getItem
) or one provided by plugin(s).args
(object): object with arguments that will be passed through all of the hooks registered formethodName
for it'spost
lifecycle part.
Throws
If
methodName
is not passed as a string, it will throw an error'methodName' must be a string.
If
args
is not passed as an object, it will throw an error'args' must be an object.
If
args
doesn't containcacheInstance
property (which is a reference to cacheInstance), it will throw an error'args' must contain 'cacheInstance' property.
Returns
(object): An object, that was passed through all (if any) registered hooks for given methodName
. Returned object will (should, see requirements) contain the very same properties as ones passed in args
object. Values might change. cacheInstance
should be exactly the same reference to cacheInstance (but it eventually depends on the plugins registered).
Example
(see: writing plugins)
Last updated