Skip to content

Export class instead of instance #13

@insolite

Description

@insolite

How about exporting of class instead of already created instance here?
Some kind of

module.exports = rcswitch.RCSwitch;

I understand that this appear to be a compatibility breaking update, so we can think of another exporting way or making of major version bump.

Let me clarify why it's important.
Sometimes it's good to have different instances of RcSwitch for different purposes. It may be very useful especially alongside the code receiving. In rcswitch there is a disabling of receiving while transmitting data, so theoretically it should work simultaneously. But in fact there are some issues with receiving after transmission. I didn't dig much in that problem cause:

  1. It works perfectly with 2 instances of RcSwitch anyway.
  2. We don't need to stop receiving at all cause we're using different PINs for sending and receiving.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions