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
- To participate in the implementation of the command, subscribe via a callback
- eg
fooSub.subscribe(row => {/*whatever*/})
Pros:
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()
Currently, all of the commands (
open,cut,paste, etc) are associated with anrxjsSubjectinstance. The exact implementation is (as of v0.0.12) a bit all over the place. Let's standardize the implementation. One possible plan:Subjects live inClipboardModel(might need a rename)tree-findercode and 3rd party integration code should follow the same patterns for interacting with the commandsnextfooSub.next(somerow)fooSub.subscribe(row => {/*whatever*/})Pros:
Cons:
subscribes to aSubjectwill also be responsible for proper cleanup: