Effect CommunityEC
Effect Community3y ago
6 replies
ts

Comparing Service Resolution Patterns: Reusing vs. As-Needed Approach

This isn't strictly related to platform, more related to effect services in general, but I'm curious, which pattern is more sensible:
1) resolving services once, top scope, and re-use them in every handler/middleware
2) grabbing them as-needed in every handler/middleware

I kinda prefer the fine-grained nature of #2, let's me modularize everything. Is there any benefit to #1?
Was this page helpful?