Skip to content

fix(mqtt): fixed how mqtt library is imported #514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(mqtt): fixed how mqtt library is imported
Minor fixes
  • Loading branch information
csarnataro committed Jan 16, 2023
commit 579d4340f8270753820a655bd8bad23eedc6b68e
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default {
resolve(),
typescript(),
commonjs(),
// terser(),
terser(),
sizes()
]
};
2 changes: 1 addition & 1 deletion rollup.config.lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default {
resolve(),
typescript(),
commonjs(),
// terser(),
terser(),
sizes()
]
};
4 changes: 2 additions & 2 deletions src/connection/Connection.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import jws from 'jws';
import mqtt, { MqttClient } from 'mqtt';
import mqtt from 'mqtt';
import { Observable, Subject } from 'rxjs';

import SenML from '../senML';
Expand Down Expand Up @@ -38,7 +38,7 @@ export class Connection implements IConnection {
host: string,
port: string | number,
token: string,
mqttConnect: (string, IClientOptions) => MqttClient
mqttConnect: (string, IClientOptions) => mqtt.MqttClient
): Promise<IConnection> {
if (!token) throw new Error('connection failed: you need to provide a valid token');
if (!host) throw new Error('connection failed: you need to provide a valid host (broker)');
Expand Down