TypeScript Connector OBSERVER - v1.0.0-alpha-11 #16
Conversation
|
Please note that I just force-pushed a change that adds the |
There was a problem hiding this comment.
I found this implementation is a little complicated. I was thinking about something much more simpler like I said in a previous comment.
For me it was just about adding some callback registering methods like registerCallbackForExport and registerCallbackForImport to the Connector class. Store the callbacks in properties like private callbacksForExport: Set<ExportCallback>; and private callbackForExport: Set<ImportCallback>;. Then call the previously registered callbacks in the Connector:export and Connector:import methods.
I think it would be better to trigger the callbacks in the Connector class rather than in the ConnectorImporterJsonldStream/ConnectorExporterJsonldStream as parsers and serializers should just parse and export.
As I mentioned in #15 (comment), I decided to split the Observer changes into a separate PR and npm version, since the hotfixes in alpha-10 really need to be released no matter what. The Observer is in good shape, too, but it does introduce minor changes to the API, so it would give us a safe rollback point if push came to shove.