mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-02-28 20:56:42 +00:00
Removed dependency on redux-actions for all reducers already migrated to typescript
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { handleActions } from 'redux-actions';
|
||||
import { Action } from 'redux';
|
||||
import { buildReducer } from '../../utils/helpers/redux';
|
||||
|
||||
export const SET_REAL_TIME_UPDATES = 'shlink/realTimeUpdates/SET_REAL_TIME_UPDATES';
|
||||
|
||||
@@ -17,11 +17,13 @@ const initialState: Settings = {
|
||||
},
|
||||
};
|
||||
|
||||
export default handleActions<Settings, any>({
|
||||
[SET_REAL_TIME_UPDATES]: (state, { realTimeUpdates }: any) => ({ ...state, realTimeUpdates }),
|
||||
type SettingsAction = Action & Settings;
|
||||
|
||||
export default buildReducer<Settings, SettingsAction>({
|
||||
[SET_REAL_TIME_UPDATES]: (state, { realTimeUpdates }) => ({ ...state, realTimeUpdates }),
|
||||
}, initialState);
|
||||
|
||||
export const setRealTimeUpdates = (enabled: boolean): Action & Settings => ({
|
||||
export const setRealTimeUpdates = (enabled: boolean): SettingsAction => ({
|
||||
type: SET_REAL_TIME_UPDATES,
|
||||
realTimeUpdates: { enabled },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user