The Rematch updated plugin
The Rematch updated plugin is the easiest plugin that we're covering. Basically, it's a plugin for maintaining timestamps when an effect is dispatched.
It can be used to prevent expensive fetch
requests within a certain time period or to throttle effects, for example, to avoid users clicking on the same button multiple times within a period of 3 seconds.
Installation and configuration
Install it like all the other official Rematch plugins:
yarn add @rematch/updated
The updated plugin also accepts some configuration with the following properties:
name
: The name of the model to be created for storing the updated timestamps. By default, it isupdated
.blacklist
: An array of model names for which the plugin won't track effects.dateCreator
: You can pass any custom implementation to createDate
objects with custom formatting or a time zone.
We are not going to use the plugin in our application because there...