UNPKG

flopflip

Version:

A feature toggle wrapper to use LaunchDarkly with React Redux

25 lines (20 loc) 427 B
// Actions export const UPDATE_FLAGS = '@flopflip/flags/update'; const initialState = {}; // Reducer export default function reducer(state = initialState, action = {}) { switch (action.type) { case UPDATE_FLAGS: return { ...state, ...action.payload, }; default: return state; } } // Action Creators export const update = flags => ({ type: UPDATE_FLAGS, payload: flags, });