Chapter 9: Composable Plugins – Create Your First Plugin
In this chapter, we'll learn how to create a Rematch plugin that will be used on our Amazhop website, warning us when we dispatch any action with a wrong payload value. Also, we'll learn how we can test this plugin using using Jest, as well as how we can build a module with the latest bundling technologies for publishing it to NPM, making it open source to everyone.
In this chapter, we'll cover the following topics:
- Preparing the environment
- Creating our plugin
- Testing our plugin
- Publishing to NPM
By the end of the chapter, you will understand how to create any Rematch plugin from the ground up with tools for bundling libraries such as Tsdx. You'll also learn how to correctly test these plugins using Jest and how we can use features that Yarn or NPM offer to test these packages locally. Also, you'll learn how to successfully publish a Rematch plugin to NPM.