Pattern<a> is the generic type for patterns matching a value of type a. A pattern can be any (nested) javascript value.
Pattern<a>
a
They can also be wildcards, like P._, P.string, P.number, or other matchers, like P.when(predicate), P.not(pattern), etc.
P._
P.string
P.number
P.when(predicate)
P.not(pattern)
Read the documentation for P.Pattern on GitHub
P.Pattern
const pattern: P.Pattern<User> = { name: P.string } Copy
const pattern: P.Pattern<User> = { name: P.string }
Pattern<a>
is the generic type for patterns matching a value of typea
. A pattern can be any (nested) javascript value.They can also be wildcards, like
P._
,P.string
,P.number
, or other matchers, likeP.when(predicate)
,P.not(pattern)
, etc.Read the documentation for
P.Pattern
on GitHub