Skip to content

Common interface for Block, Page, and Database #162

Open
@pierce-m

Description

@pierce-m

It would be very helpful to abstract these objects away in a comment interface, as currently in our code we use a lot of switch/case such as

switch obj.Type{
  case "block":
    return obj.CreatedAt
  case "page":
    return obj.CreatedAt
}

It would be much nicer to be able to do

obj.GetCreatedAt()

simplifying the client code greatly. It seems Blocks have a common Block interface, I am wondering if we can create a common interface shared between Blocks, Pages, and Databases to access these common fields?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions