Package: effect
Module: Inspectable
A base prototype object that implements the Inspectable interface.
When to use
Use as a prototype for plain objects that should share standard inspectable behavior.
Details
This object provides default implementations for the Inspectable methods.
It can be used as a prototype for objects that want to be inspectable,
or as a mixin to add inspection capabilities to existing objects.
Example (Using the base inspectable prototype)
import { Inspectable } from "effect"
// Use as prototype
const myObject = Object.create(Inspectable.BaseProto)
myObject.name = "example"
myObject.value = 42
console.log(myObject.toString()) // Pretty printed representation
// Or extend in a constructor
function MyClass(this: any, name: string) {
this.name = name
}
MyClass.prototype = Object.create(Inspectable.BaseProto)
MyClass.prototype.constructor = MyClass
Signature
declare const BaseProto: Inspectable
Since v2.0.0