Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stateGetter failing on Non-Immutable store #177

Closed
bellmoose opened this issue Aug 30, 2017 · 3 comments
Closed

stateGetter failing on Non-Immutable store #177

bellmoose opened this issue Aug 30, 2017 · 3 comments

Comments

@bellmoose
Copy link
Contributor

bellmoose commented Aug 30, 2017

The get method in stateGetter is failing when using a non Immutable store:
`

export const get = (state, key, entry) => {

if (!state) {
    return null;
}

const isImmutable = typeof state.get === 'function';
const stateItem = isImmutable
    ? state.get(key)
    : state[key];

if (!stateItem) {
    return null;
}

return stateItem.get(entry);

};

`

Last line should be
return isImmutable ? stateItem.get(entry) : stateItem[entry];

Trying to put together a Pull Request, but having some issues with the build for some reason.

Associated test in stateGetter.test.js
`

it('Should return state when its not stored using immutable', () => {
const state = { data: { thing: [1] } };
const props = {};

    expect(
        stateGetter(state, props, 'data', 'thing')
    ).toEqual(List([1]));
});

});

`

@bencripps
Copy link
Owner

A pull request would be great, what build issues are you having?

@bellmoose
Copy link
Contributor Author

Needed to upgrade node apparently. Working on getting a PR working.

@bencripps
Copy link
Owner

bencripps commented Sep 29, 2017

This issue was resolved with #179

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

No branches or pull requests

2 participants