reducers
Table of Contents
keplerGlReducer
Kepler.gl reducer to be mounted to your store. You can mount keplerGlReducer at property keplerGl, if you choose to mount it at another address e.g. foo you will need to specify it when you mount KeplerGl component in your app with getState: state => state.foo
Examples
import keplerGlReducer from '@kepler.gl/reducers';
import {createStore, combineReducers, applyMiddleware, compose} from 'redux';
import {taskMiddleware} from 'react-palm/tasks';
const initialState = {};
const reducers = combineReducers({
// <-- mount kepler.gl reducer in your app
keplerGl: keplerGlReducer,
// Your other reducers here
app: appReducer
});
// using createStore
export default createStore(reducer, initialState, applyMiddleware(taskMiddleware));keplerGlReducer.initialState
Return a reducer that initiated with custom initial state. The parameter should be an object mapping from subreducer name to custom subreducer state, which will be shallow merged with default initial state.
Default subreducer state:
Parameters
iniStObject custom state to be merged with default initial state
Examples
keplerGlReducer.plugin
Returns a kepler.gl reducer that will also pass each action through additional reducers spiecified. The parameter should be either a reducer map or a reducer function. The state passed into the additional action handler is the instance state. It will include all the subreducers visState, uiState, mapState and mapStyle. .plugin is only meant to be called once when mounting the keplerGlReducer to the store. Note This is an advanced option to give you more freedom to modify the internal state of the kepler.gl instance. You should only use this to adding additional actions instead of replacing default actions.
Parameters
Examples
mapStateLens
Connect subreducer mapState, used with injectComponents. Learn more at Replace UI Component
Parameters
reduxStateany
mapStyleLens
Connect subreducer mapStyle, used with injectComponents. Learn more at Replace UI Component
Parameters
reduxStateany
providerStateLens
Connect subreducer providerState, used with injectComponents. Learn more at Replace UI Component
Parameters
reduxStateany
uiStateLens
Connect subreducer uiState, used with injectComponents. Learn more at Replace UI Component
Parameters
reduxStateany
visStateLens
Connect subreducer visState, used with injectComponents. Learn more at Replace UI Component
Parameters
reduxStateany
Last updated
Was this helpful?