Skip to content

Factory to build encode and decode functions to share encoders and decoders #56

Closed

Description

@gfx

I'm thinking about a factory function that creates { encode, decode } functions, just like as https://github.com/mcollina/msgpack5

The interface is something like this:

import { factory } from "@msgpack/msgpack";
const { encode, decode } = factory({
  extensionCodec, // common options
  encodeOptions, // encoder options
  decodeOptions, // decoder options
});

The factory pattern is also adopted by msgpack-ruby, which is designed by the primary author of MessagePack.

Activity

  1. gfx commented on Jul 16, 2019

    @gfx
    MemberAuthor

    This is not suitable for this module because it has several encode and decode variants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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