UNPKG

ipfs-core

Version:

JavaScript implementation of the IPFS specification

15 lines (13 loc) 290 B
/** * @param {object} config * @param {import('../types').NetworkService} config.network */ export function createIsOnline ({ network }) { /** * @returns {boolean} */ return () => { const net = network.try() return net != null && Boolean(net.libp2p.isStarted()) } }