Skip to content

Conversation

JamieDixon
Copy link
Contributor

Fixes: #1324

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's check a few more data types: null, undefined, and string should throw.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few extra checks for the types mentioned. I've gone with the assertion style I've seen elsewhere rather than something like:

const cases = [undefined, null, ''];
    cases.map(arg =>
      expect(() =>
        store.subscribe(arg))
      .toThrow())

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: please remove the extra newline

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 removed in latest commit.

gaearon added a commit that referenced this pull request Jan 30, 2016
subscribe to throw when listener is not a function
@gaearon gaearon merged commit d98c3f0 into reduxjs:master Jan 30, 2016
@gaearon
Copy link
Contributor

gaearon commented Jan 31, 2016

Out in 3.1.6, thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants