A function that can be used to start 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 { start } from '@libp2p/interface'import type { Startable } from '@libp2p/interface'const startable: Startable = { start: () => {}, stop: () => {}}const notStartable = 5await start( startable, notStartable) Copy
import { start } from '@libp2p/interface'import type { Startable } from '@libp2p/interface'const startable: Startable = { start: () => {}, stop: () => {}}const notStartable = 5await start( startable, notStartable)
A function that can be used to start 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.