You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which makes it hard for objects to implement both cleanly.
In theory, we could return Promise<Dataset> & EventEmitter or even be fancy and do Promise<Dataset & EventEmitter> & EventEmitter for full .then compatibility, but this gets messy.
Any chance we could either rename this method or change its return type?
The text was updated successfully, but these errors were encountered:
It would be the same for the match method. I don't think it makes sense to prefix or postfix the methods to distinguish them. The stream and dataset interfaces are for different use cases. The import method of the Dataset is the only method that consumes a Stream and creates a bridge between both worlds. As the Stream is just consumed, using the Dataset interface doesn't require deeper knowledge about the Stream interface. The name import is the best match for this use case. For the rare case where you want to have both interfaces, it's probably better to use different objects for each interface. Like this:
constdataset=factory.dataset()conststore=newDatasetStore(dataset)// store.dataset implements the Dataset interfaceawaitstore.dataset.import(quadStream)// store implements the Store interfacestore.match().on('data',quad=>console.log(quad))
The
Dataset
signature isIn contrast, the
Sink
signature iswhich makes it hard for objects to implement both cleanly.
In theory, we could return
Promise<Dataset> & EventEmitter
or even be fancy and doPromise<Dataset & EventEmitter> & EventEmitter
for full.then
compatibility, but this gets messy.Any chance we could either rename this method or change its return type?
The text was updated successfully, but these errors were encountered: