Skip to content

Wrap classes with factory functions #1

@matteocontrini

Description

@matteocontrini

Instead of

class Card() {
  constructor() {},
  method() {},
  _private() {}
}

we should be doing

module.exports = function cardFactory() {
  // constructor code
  let private = () => {};
  return {
    method: function method() {}
  };
};

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions