Skip to content

Implement blocks reducer #2

Description

@nadeemkhedr

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']
  }
};


Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions