MCPcopy Create free account
hub / github.com/Effect-TS/effect / setting

Function setting

packages/effect/src/unstable/cli/GlobalFlag.ts:122–137  ·  view source on GitHub ↗
(
  id: Id
)

Source from the content-addressed store, hash-verified

120 * @since 4.0.0
121 */
122export const setting = <const Id extends string>(
123 id: Id
124) =>
125<A>(options: {
126 readonly flag: Flag.Flag<A>
127}): Setting<Id, A> => {
128 settingIdCounter += 1
129 const ref = Context.Service<Setting.Identifier<Id>, A>(
130 `effect/unstable/cli/GlobalFlag/${id}/${settingIdCounter}`
131 )
132 return Object.assign(ref, {
133 _tag: "Setting" as const,
134 id,
135 flag: options.flag
136 })
137}
138
139let settingIdCounter = 0
140

Callers 1

GlobalFlag.tsFile · 0.85

Calls 1

assignMethod · 0.80

Tested by

no test coverage detected