canonical-reducer-composition icon indicating copy to clipboard operation
canonical-reducer-composition copied to clipboard

Constructor overrites initial state?

Open kzap opened this issue 8 years ago • 2 comments

the constructor examples overwrites initial state by default so what if your initial state comes from outside? how do you insert that after the CONSTRUCTOR or do we make the CONSTRUCTOR method decide how to merge passed data?

CONSTRUCT (domain) {
            return domain.concat(
              Immutable.fromJS([
                {
                    id: _.uniqueId(),
                    name: 'foo',
                    done: true
                },
                {
                    id: _.uniqueId(),
                    name: 'bar',
                    done: false
                },
                {
                    id: _.uniqueId(),
                    name: 'baz',
                    done: false
                },
                {
                    id: _.uniqueId(),
                    name: 'quux',
                    done: false
                }
            ])
          );
        },

kzap avatar Nov 07 '15 12:11 kzap