A function that can be used to stop and objects passed to it. This checks that an object is startable before invoking its lifecycle methods so it is safe to pass non-Startables in.
Startable
import { stop } from '@libp2p/interface'import type { Startable } from '@libp2p/interface'const startable: Startable = { start: () => {}, stop: () => {}}const notStartable = 5await stop( startable, notStartable) Copy
import { stop } from '@libp2p/interface'import type { Startable } from '@libp2p/interface'const startable: Startable = { start: () => {}, stop: () => {}}const notStartable = 5await stop( startable, notStartable)
A function that can be used to stop and objects passed to it. This checks that an object is startable before invoking its lifecycle methods so it is safe to pass non-
Startable
s in.