0.2.0 • Published 4 years ago

@groupby/elements-cache-driver-plugin v0.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

GroupBy Elements Cache Plugin

This package contains the GroupBy Elements Cache Driver Plugin class.

Usage

To use the plugin, simply instantiate it and register it with Core:

const cacheDriverPlugin = new CacheDriverPlugin();
core.register(cacheDriverPlugin);

Events

This plugin listens for and dispatches a number of events. These events are defined in the @groupby/elements-events package.

Received

  • CACHE_REQUEST: When received, a request to the cache is made and a response is dispatched with the event name provided in the payload of CACHE_REQUEST. It is recommended to prefix the return event name with the value of CACHE_RESPONSE_PREFIX.

Dispatched

  • A cache response event: Dispatched when a CACHE_REQUEST is fulfilled. The event is dispatched under the name provided by the corresponding CACHE_REQUEST payload.