flopflip
Version:
A feature toggle wrapper to use LaunchDarkly with React Redux
25 lines (20 loc) • 463 B
JavaScript
// Actions
export const UPDATE_STATUS = '@flopflip/status/update';
const initialState = { isReady: false };
// Reducer
export default function reducer(state = initialState, action = {}) {
switch (action.type) {
case UPDATE_STATUS:
return {
...state,
isReady: action.payload.isReady,
};
default:
return state;
}
}
// Action Creators
export const update = status => ({
type: UPDATE_STATUS,
payload: status,
});