// hardcoded json config provider
const JsonConf: ConfigSchema = {
CONSUMER_KEY: "...",
CONSUMER_SECRET: "...",
API_ENDPOINT: "...",
};
const hardCodedConfFromJson = ConfigProvider.fromJson(JsonConf);
const hardCodedConfLayer = Layer.setConfigProvider(hardCodedConfFromJson);
// config service
class ConfigService extends Effect.Service<ConfigService>()("ConfigService", {
effect: Effect.gen(function* (_) {
const CONSUMER_KEY = yield* Config.string("CONSUMER_KEY");
const CONSUMER_SECRET = yield* Config.string("CONSUMER_SECRET");
const API_ENDPOINT = yield* Config.string("API_ENDPOINT");
return { CONSUMER_KEY, CONSUMER_SECRET, API_ENDPOINT };
}),
// dependencies: [],
}) {
static Dev = Effect.gen(function* (_) {
const CONSUMER_KEY = yield* Config.string("CONSUMER_KEY");
const CONSUMER_SECRET = yield* Config.string("CONSUMER_SECRET");
const API_ENDPOINT = yield* Config.string("API_ENDPOINT");
return { CONSUMER_KEY, CONSUMER_SECRET, API_ENDPOINT };
});
<-- HERE, HOW DO I GIVE THIS STATIC METHOD IT'S "DEPENDENCIES: []">
}
// hardcoded json config provider
const JsonConf: ConfigSchema = {
CONSUMER_KEY: "...",
CONSUMER_SECRET: "...",
API_ENDPOINT: "...",
};
const hardCodedConfFromJson = ConfigProvider.fromJson(JsonConf);
const hardCodedConfLayer = Layer.setConfigProvider(hardCodedConfFromJson);
// config service
class ConfigService extends Effect.Service<ConfigService>()("ConfigService", {
effect: Effect.gen(function* (_) {
const CONSUMER_KEY = yield* Config.string("CONSUMER_KEY");
const CONSUMER_SECRET = yield* Config.string("CONSUMER_SECRET");
const API_ENDPOINT = yield* Config.string("API_ENDPOINT");
return { CONSUMER_KEY, CONSUMER_SECRET, API_ENDPOINT };
}),
// dependencies: [],
}) {
static Dev = Effect.gen(function* (_) {
const CONSUMER_KEY = yield* Config.string("CONSUMER_KEY");
const CONSUMER_SECRET = yield* Config.string("CONSUMER_SECRET");
const API_ENDPOINT = yield* Config.string("API_ENDPOINT");
return { CONSUMER_KEY, CONSUMER_SECRET, API_ENDPOINT };
});
<-- HERE, HOW DO I GIVE THIS STATIC METHOD IT'S "DEPENDENCIES: []">
}