Comments (2)
There's a choice to be made;
Given this:
interface Service {
foo: (x: string, y: number) => Effect.Effect<never, never, string>
bar: (a: string) => Effect.Effect<never, never, string>
baz: Effect.Effect<never, never, string>
}
we cannot distingish before execution if a member is a function or a constant (effect)
so several choices:
we define a function to proxy functions only and another for constants
{
...
foo: (x: string, y: number) => Effect.Effect<never, never, string>
bar: (a: string) => Effect.Effect<never, never, string>
}
and
{
...
baz: Effect.Effect<Service, never, string>
}
we proxy constants as function with a lambda; here what the result would be
{
...
foo: (x: string, y: number) => Effect.Effect<never, never, string>
bar: (a: string) => Effect.Effect<never, never, string>
baz: () => Effect.Effect<Service, never, string>
}
we proxy constants and function in separate return entries
{
const { functions, constants } = deriveAccess(Service)
}
There's also a perf difference, in the second case, there's a typeof necessary at runtime that adds runtime cost
From these, the function name might be adapted
from io.
I'm leaning towards implementing separate functions for functions and constants and a third with both results.
from io.
Related Issues (20)
- Configurable path delimiter in ConfigError HOT 1
- Feature Request - Add Pretty Print for `Exit` Data Type
- Feature request: tapErrorTag
- Feature request: throwTag, throwTagWith
- Feature request: Support using multiple Caches HOT 1
- Feature request: setConfigProviderEffect HOT 1
- Bug: Functions that work with tagged error fail at type level when non-tagged error present HOT 1
- Feature request: printing metrics
- Cache / Request Cache should allow specifying a weight function and a maximum weight
- Tiered caches
- Persisted caches
- Feature request: Multi-arg flatMap HOT 3
- From Discord: Difference in callback parameters for `filterOrFail` and `filterOrDie`
- From Discord: Proposing a `Effect.flatMapError` Function HOT 1
- From Discord: Missing Stack Trace in EffectA
- `Effect.serviceMembers` (and variants) do not recognize `Stream` returning members HOT 6
- From Discord: Converting Either to Effect in ZIO: ZIO.fromEither
- [Bug] Cause.reduceWithContext HOT 2
- From Discord: Lack of Concurrency/Batching Option for Effect.replicteEffect
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from io.