Creating a Context-Specific Layer for Index Migration in MongoDB Repositories

Is it possible to create an Effect or a Layer which requires that its context contains only values conforming to certain interface, and then grab all of these values as an array\tuple?

I’m trying to create a helper which would, with minimal boilerplate, create an index migration job for mongodb base repositories which all have syncIndexes() method. I’d like to be able to simply provide the layers outputting said repositories and get a program which calls that method on all of them.
Was this page helpful?