Skip to content

Support for classes #425

@obeattie

Description

@obeattie

I might well be missing something, so would love to be told what!

I'm trying to use optics-ts in combination with Jotai to read/modify some deeply-nested data structures. In these data structures, I commonly have instances of classes, whose fields I'd like to be able to modify. optics-ts lets me do this, but the class instances are silently converted to plain objects (without the proper prototype), meaning the inferred type of the resulting object is wrong.

Is there a way I can do better here? Thanks!

🔗 Here's a quick StackBlitz to demonstrate the issue

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