import { process } from '@oliveai/ldk';
import { Cancellable } from '@oliveai/ldk/dist/cancellable';
const listenForApplicationStart = () => {
let cancellableStream: Cancellable;
process.listenAll((response) => {
const {processInfo, processAction} = response;
processInfo.command.includes('Evernote') &&
processAction === process.ProcessAction.Started
// Logic to respond to the program starting...
// Cancel the listening stream if needed.
cancellableStream.cancel();
.then((cancellable: Cancellable) => {
// Set the value of the stream so that we can close it if needed
cancellableStream = cancellable;