Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
);
case ContextMenuEntry.SendActiveTab: return pipe(
getActiveTab,
T.map(flow(
O.chain(tab => OT.fromNullable(tab.title, tab.url)),
O.map(([title, url]) => [{ title, url }]),
O.chain(NEA.fromArray),
)),
);
case ContextMenuEntry.SendLink: return pipe(
u,
O.map(url => [{ url, title: url }]),
O.chain(NEA.fromArray),
TO.fromOption,
);
default: return TO.none;
}
};
export const listenForIsomorphicMessages = (f: (m: IsomorphicMessage) => void): IO =>
createIsomorphicMessageListener(f)(flow(
O.fromPredicate(isIsomorphicMessage),
TO.fromOption,
));