mswjs / socket.io-binding

Connection wrapper for mocking Socket.IO with MSW.
1 stars 1 forks source link

Rename "toSocketIoConnection()" function #4

Closed kettanaito closed 7 months ago

kettanaito commented 8 months ago

I don't like the current name of the toSocketIoConnection() function.

kettanaito commented 7 months ago

The binding function is called bind. It doesn't include any context and the context is taken from the importing package. In case of multiple bindings (which is unlikely), the developer can use import aliases to distinguish between the different bind functions.

import { bind as bindSocketIo } from '@mswjs/socket.io-binding'
import { bind as bindPartyKit } from '@mswjs/partykit-binding'