Override publication or controller

Is there a way to override/replace publication? The publication I’d like to override defined in a package I have no access to. But it’s done not in optimal way and I’d like to replace it with my own implementation. Is there a way to do it?

Just in case I’m talking about adminCollectionsCount publication from meteor-admin package. It counts documents one by one and it is very slow when there is a lot of data. Not sure that I can do it better, so I have another option in mind.

Maybe there is a way to override AdminController and remove adminCollectionsCount subscription from waitOn section? In this case it at least would not block UI.

You can fork the package, do your own adjustments and place it in the /packages directory. I have no idea if you’d be able to override an existing publication, but as it sounds quite hacky imo, I would just make the fork.

Thank you. I keep it in mind but hope there is an easier way.