Skip to content

Tabs module (and update module): rationalise mutable state #2

@tomcl

Description

@tomcl

To keep things clean all mutable state should be in one place. The DOM makes mutable state, but using it as is done now to store extra info about files loaded is not good.

I suggest: keep master copy of all the tab state in F# mutable variables. Have a single update function that will render all current state correctly - creating or changing tab content as needed. When changing state alter the F# mutables then call the update function. Redo the code using functional abstraction to compress it. It will be easier to do this than write a lot of separate "change DOM state" code in response to various state changes.

Nearly all state can be handled like this but the buffer contents have to be kept with the master copy in the editor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions