-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Hi, thanks for your work on this interesting proposal. Would be possible to initialize a protocol field by accessing this
, or would that need to be a method? E.g.:
protocol Pageable {
pageSize
items
getFirstPage() {
return this[Pageable.items].slice(0, this[Pageable.pageSize])
}
}
class GroceryList {
constructor(items) {
this.items = items
}
implements protocol Pageable {
pageSize = 2
items = this.items // <-- Would this be legal?
get items() { return this.items } // <-- Or this?
items() { return this.items } // <-- Or would this be the only way to go?
}
}
Metadata
Metadata
Assignees
Labels
No labels