Skip to content

Standardize the interface and behavior of command-related Subject instances #54

@telamonian

Description

@telamonian

Currently, all of the commands (open, cut, paste, etc) are associated with an rxjs Subject instance. The exact implementation is (as of v0.0.12) a bit all over the place. Let's standardize the implementation. One possible plan:

  • All command-related Subjects live in ClipboardModel (might need a rename)
  • Both internal tree-finder code and 3rd party integration code should follow the same patterns for interacting with the commands
    • To trigger the command, supply the value on which the command should act via next
      • eg fooSub.next(somerow)
    • To participate in the implementation of the command, subscribe via a callback
      • eg fooSub.subscribe(row => {/*whatever*/})

Pros:

  • very flexible

Cons:

  • 3rd party code that subscribes to a Subject will also be responsible for proper cleanup:
// subscribe
const mysubscription = fooSub.subscribe(somecallback);

// later, clean up
mysubscription.unsubscribe()

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmaintenanceplumbing with the porcelain

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions