Skip to content

Commit

Permalink
streamline + refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tysonrm committed Nov 20, 2022
1 parent 0828694 commit 8484272
Show file tree
Hide file tree
Showing 5 changed files with 7,984 additions and 10,820 deletions.
6 changes: 3 additions & 3 deletions src/domain/datasource-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ const DsCoreExtensions = superclass =>
return new Transform({
objectMode: true,

transform (chunk, _encoding, callback) {
transform (chunk, _encoding, next) {
this.push(ModelFactory.loadModel(broker, ctx, chunk, ctx.name))
callback()
next()
}
})
}
Expand All @@ -101,7 +101,7 @@ const DsCoreExtensions = superclass =>
if (options?.writable)
return isMainThread
? super.list(options)
: super.list({ ...options, transfrom: this.transform() })
: super.list({ ...options, transform: this.transform() })

const arr = await super.list(options)

Expand Down
11 changes: 7 additions & 4 deletions src/domain/make-ports.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,12 @@ export default function makePorts (ports, adapters, broker, datasource) {
const disabled = portConf.disabled || !adapters[port]

// Listen for event that will invoke this port
const rememberPort = disabled
? false
: addPortListener(portName, portConf, broker, datasource)
const rememberPort = addPortListener(
portName,
portConf,
broker,
datasource
)

/**
*
Expand Down Expand Up @@ -223,7 +226,7 @@ export default function makePorts (ports, adapters, broker, datasource) {
}

try {
// call the inbound or oubound adapter and wait
// call the inbound or oubound adapte
const result = await adapters[port]({ model: this, port, args })

// Stop the timer
Expand Down
Loading

0 comments on commit 8484272

Please sign in to comment.