Skip to content

feat(preview): add public API for deviceFound and deviceLost for preview devices #4083

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 4 commits into from
Nov 1, 2018

Conversation

Fatme
Copy link
Contributor

@Fatme Fatme commented Nov 1, 2018

We want to expose deviceFound and deviceLost for preview devices as a public api so Sidekick can use them.

const tns = require("nativescript-cli");
tns.previewDevicesService.on("deviceFound", device => {
    console.log("device found", device);
});
tns.previewDevicesService.on("deviceLost", device => {
    console.log("device lost", device);
});

PR Checklist

@Fatme Fatme added this to the 5.0.1 milestone Nov 1, 2018
@Fatme Fatme changed the title feat: add public API for deviceFound and deviceLost for preview devices feat(preview): add public API for deviceFound and deviceLost for preview devices Nov 1, 2018
@Fatme Fatme force-pushed the fatme/preview-api branch from e9e2e50 to 957f0a4 Compare November 1, 2018 07:05
@Fatme Fatme force-pushed the fatme/preview-api branch from 957f0a4 to 569b498 Compare November 1, 2018 07:19
@Fatme Fatme force-pushed the fatme/preview-api branch from 75aeedd to aeec0ac Compare November 1, 2018 07:37
@@ -34,4 +33,11 @@ declare global {
*/
link: boolean;
}

interface IPreviewDevicesService extends EventEmitter {
connectedDevices: Device[];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to expose a public setter? We could expose just a getConnectedDevices method.


interface IPreviewDevicesService extends EventEmitter {
connectedDevices: Device[];
onDevicesPresence(devices: Device[]): void;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the context of this service, this should be something like set/update ConnectedDevices.

@Fatme Fatme merged commit 447f42b into release-5.0.1 Nov 1, 2018
@Fatme Fatme deleted the fatme/preview-api branch November 1, 2018 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants