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

Implement blocks reducer #2

Closed
nadeemkhedr opened this issue Feb 19, 2017 · 0 comments · Fixed by #6
Closed

Implement blocks reducer #2

nadeemkhedr opened this issue Feb 19, 2017 · 0 comments · Fixed by #6
Assignees
Labels
Milestone

Comments

@nadeemkhedr
Copy link
Owner

nadeemkhedr commented Feb 19, 2017

Development

In the reducer handle the following actions

BLOCK_ADD                      //block is added
BLOCK_REMOVE               //block is removed
BLOCK_WORD_REMOVE  //word in a block is removed

the blocks reducer will contain two reducers

  • byId
  • allIds

And the store should look like this

const store = {
  ...
  blocks: {
    byId: {
      'block1': {
        id: 'block1',
        words: ['1', '2']
      },
      'block2': {
        id: 'block2',
        words: ['3', '4']
      }
    },
    allIds: ['block1', 'block2']
  }
};


@nadeemkhedr nadeemkhedr self-assigned this Feb 19, 2017
@nadeemkhedr nadeemkhedr added this to the Release 1 milestone Feb 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant