Skip to content

Feature request: extend from custom adapter #383

Closed
@sebamarynissen

Description

@sebamarynissen

I have a use case we're I have a custom adapter that extends from the default socket.io in memory adapter that I would like to use in combination with socket.io-redis. It's possible to add this functionality with full backwards compatibility as follows:

import { Adapter } from 'socket.io-adapter';

export function extendFrom(BaseAdapter) {
  return class RedisAdapter extends BaseAdapter {
    // No other changes to the code required.
  };
}

export const RedisAdapter = extendFrom(Adapter);

I will try to file a PR for this, but I have no experience in TypeScript and my first attempts won't compile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions