Merge commit '36c66dd290d3ce6eb1ccd310d0c658d4a32bb8eb' as 'repos/effect'
This commit is contained in:
17
repos/effect/.changeset/schema-as-class.md
Normal file
17
repos/effect/.changeset/schema-as-class.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
"effect": patch
|
||||
---
|
||||
|
||||
Schema: add `asClass` API to turn any schema into a class with static method support.
|
||||
|
||||
**Example**
|
||||
|
||||
```ts
|
||||
import { Schema } from "effect"
|
||||
|
||||
class MyString extends Schema.asClass(Schema.String) {
|
||||
static readonly decodeUnknownSync = Schema.decodeUnknownSync(this)
|
||||
}
|
||||
|
||||
MyString.decodeUnknownSync("a") // "a"
|
||||
```
|
||||
Reference in New Issue
Block a user