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

Method addSideEffect

packages/effect/src/Codegen.ts:590–597  ·  view source on GitHub ↗

* Registers a side-effect import, preserving its first registration order.

(module: string, attributes = "")

Source from the content-addressed store, hash-verified

588 * Registers a side-effect import, preserving its first registration order.
589 */
590 addSideEffect(module: string, attributes = ""): this {
591 const source = `import ${literal(module)}${attributes}`
592 if (!this.#sideEffects.has(source)) {
593 this.#sideEffects.add(source)
594 this.#importOrder.push(source)
595 }
596 return this
597 }
598
599 /**
600 * Appends a source fragment after the module's declarations.

Callers 3

Codegen.test.tsFile · 0.80
compileCallbackFunction · 0.80

Calls 4

hasMethod · 0.65
addMethod · 0.65
pushMethod · 0.65
literalFunction · 0.50

Tested by

no test coverage detected