gajus / redux-immutable

redux-immutable is used to create an equivalent function of Redux combineReducers that works with Immutable.js state.
Other
1.88k stars 82 forks source link

Error: Reducer definition object must begin with a domain definition. #10

Closed munkh-altai closed 8 years ago

munkh-altai commented 8 years ago

Hello i got Error: Reducer definition object must begin with a domain definition. how to fix this error i really want to use redux-immubtale

store/store.js ///////////////////////////////////////////////////////////////////////////////////////////////// import {createStore} from 'redux'; import {combineReducers} from 'redux-immutable'; import Immutable from 'immutable'; import * as reducers from '../reducers/reducers'; let app, store, state; state = {}; state.setup = {}; state.listData = { pageLimit: 10, currentPage: 1, searchValue: '', data:{} }; state = Immutable.fromJS(state); app = combineReducers(reducers); store = createStore(app, state); export default store; ///////////////////////////////////////////////////////////////////////////////////////////////// reducers/reducers.js ///////////////////////////////////////////////////////////////////////////////////////////////// export default { SETUP: (domain, action) => domain.set('setup',action.setupData),

listData: {

    SET_LIST (domain, action) {
        return domain.set('data', action.listData)
    },
    SET_CURENT_PAGE (domain, action) {
        return domain.set('currentPage', action.page)
    },
    SET_SEARCH (domain, action) {
        return domain.set('searchValue', action.word)
    },
    SET_PAGE_LIMIT (domain, action) {
        return domain.set('pageLimit', action.limit)
    }

}

}; /////////////////////////////////////////////////////////////////////////////////////////////////

adamcharnock commented 8 years ago

I know issues are not really for support requests, but I'm having the exact same problem. I have yet to come across the specific concept of 'domains' in redux.

gajus commented 8 years ago

@altaihero Please format the issue.

munkh-altai commented 8 years ago

i have solved my problem, thank for time

gajus commented 8 years ago

Can you share the solution and format the original issue?

On Jan 26, 2016, at 15:48, Munkh-Altai notifications@github.com wrote:

i have solved my problem, thank for time

— Reply to this email directly or view it on GitHub.