I am getting an error in the selectors of a react application when using toJS with the reselect library.
I tried importing toJS
as well as not importing it and I get the error no matter what.
nodeCreationWindow.get(...).toJS is not a function
import { createSelector } from 'reselect'
import { toJS } from 'immutable'
const selectNodeCreationWindow = () => (state) => state.get('nodeCreationWindow')
const selectNodes = () => createSelector(
selectNodeCreationWindow(),
(nodeCreationWindow) => {
return nodeCreationWindow.get('nodes').toJS()
}
)
const selectTags = () => createSelector(
selectNodeCreationWindow(),
(nodeCreationWindow) => nodeCreationWindow.get('tags').toJS()
)
const selectSuggestions = () => createSelector(
selectNodeCreationWindow(),
(nodeCreationWindow) => nodeCreationWindow.get('suggestions').toJS()
)
export {
selectNodes,
selectTags,
selectSuggestions
}