client/src/reducers/notesReducer.js
changeset 12 48ddaa42b810
parent 3 3b5d37d84cfe
child 29 4cfeabef7d5e
equal deleted inserted replaced
11:6fb4de54acea 12:48ddaa42b810
     1 import Immutable from 'immutable';
     1 import Immutable from 'immutable';
       
     2 // import PouchDB from 'pouchdb';
     2 
     3 
     3 import * as types from '../constants/actionTypes';
     4 import * as types from '../constants/actionTypes';
     4 import noteRecord from '../store/noteRecord';
     5 import noteRecord from '../store/noteRecord';
     5 
     6 
       
     7 // const db = new PouchDB('notes');
       
     8 
       
     9 // db.allDocs({ include_docs: true, descending: true }, function(err, doc) {
       
    10 //   console.log(doc.rows)
       
    11 // });
     6 
    12 
     7 export default (state = Immutable.List([]), action) => {
    13 export default (state = Immutable.List([]), action) => {
     8   switch (action.type) {
    14   switch (action.type) {
     9     case types.ADD_NOTE:
    15     case types.ADD_NOTE:
    10       return state.push(new noteRecord(action.note));
    16       return state.push(new noteRecord(action.note));