-
Notifications
You must be signed in to change notification settings - Fork 2
Schemas And Types
Justin Meyer edited this page Sep 16, 2021
·
9 revisions
Map types:
{
type: "map",
keys: {
name: MaybeString
id: MaybeNumber
}
}
List Types
{
type: "list",
values: String
keys: {
count: Number
}
}
{
[can.isMember](value){
return // if `value` is an instance of the type
}
[can.new](value) {
return // make an instance of the type given value
}
[can.serialize](value) {
return // an JSON.stringify() representation of the instance
}
}