Media Library lifecycles

Does this approach work with Strapi v4? I’m looking to do something similar but I think there have been quite a few changes to how plugin lifecycle hooks work in v4.