Skip to content

Branching by type in a generic way #4

@LeaVerou

Description

@LeaVerou

In the initial Treecle port, I removed all the functionality that supports type => something object literals and instead it only supports functions for these things. I instead added code to Vastly to transform object literals into functions.

But it just dawned on me: this would be very useful in Treecle too, it's just that we can't depend on node.type returning a useful type. But we could have a config.getType() method, which by default returns the object [[ Class ]], but can be overridden (e.g. Vastly would do config.getType = n => n.type).

Any objections @adamjanicki2 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions