Skip to content

types: connect should allow null as the first argument #200

Closed
@no-stack-dub-sack

Description

@no-stack-dub-sack

connect appears to allow a a null argument as the first argument, in the event that you only need to fire an action from a particular component, and do not need to map any state slices to your component's state. e.g.

constructor(public $ngRedux: ngRedux.INgRedux) {
  this.unsubscribe = $ngRedux.connect(null, componentActions)(this);
}

However, the types for connect are not written with an overload to support this. This forces you to write a mapStateToThis method that is ultimately not needed. It looks like there are some other changes holding up the 4.1.0 release, so this could be an easy fix to sneak in before that release.

Will you accept a PR to fix this?

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