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

Default Reducer not updating the store #55

Open
2 of 9 tasks
krisvegh opened this issue Mar 26, 2018 · 4 comments
Open
2 of 9 tasks

Default Reducer not updating the store #55

krisvegh opened this issue Mar 26, 2018 · 4 comments
Labels

Comments

@krisvegh
Copy link

krisvegh commented Mar 26, 2018

This is a...

  • feature request
  • bug report
  • usage question

What toolchain are you using for transpilation/bundling?

  • @angular/cli
  • Custom @ngTools/webpack
  • Raw ngc
  • SystemJS
  • Rollup
  • Other

Environment

NodeJS Version: 8.1.1
Typescript Version: 2.3.4
Angular Version: 4.1.2
@angular-redux/store version: 7.1.1
@angular/cli version: (if applicable)
OS: OSX

Link to repo showing the issus

(optional, but helps a lot)

Expected Behaviour:

Input field on change should update the corresponding value in the redux store.

Actual Behaviour:

Input field value doesn't change on keystroke, as it's bound to the store which is not updating.

Stack Trace/Error Message:

Additional Notes:

Just need some help please. Any idea where the problem could be?

<form [connect]="['advertiser', 'campaign', 'campaign']">
    <div class="input-container">
        <input
            ngControl
            ngModel
            class="form-control"
            type="text"
            name="name">
    </div>
</form>

1: The input field shows the value coming from the redux store, so the path is good.
2: On keydown, I can see the action firing in the devtools, payload looks fine.
3. When I inspect State.assign in state.js, state, path, and value arguments look fine but for some reason, the state doesn't get updated. Sorry I can't show repo, but maybe someone has any idea what I'm missing.

Thank you.

@krisvegh
Copy link
Author

I found the issue.

The problem was that I have campaign / campaign in the path I want to access and library doesn't handle that properly. I marked it now as a bug.

This:
https://github.com/angular-redux/form/blob/master/source/state.ts#L44

...indexOf will always find the first one.

@maplion
Copy link

maplion commented Apr 16, 2018

@krisvegh So did it work when you renamed one of the 'campaign'?

@krisvegh
Copy link
Author

@maplion Yes, it did.

@smithad15 smithad15 added the bug label Jul 9, 2018
@prog-24
Copy link

prog-24 commented Jan 1, 2019

This is still a bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants