-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a5e287b
commit 92ff333
Showing
4 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { createSlice, PayloadAction } from "@reduxjs/toolkit"; | ||
|
||
export interface UiState { | ||
decimalSeparator: string; | ||
thousandsSeparator: string; | ||
} | ||
|
||
const initialState: UiState = { | ||
decimalSeparator: ".", | ||
thousandsSeparator: " ", | ||
}; | ||
|
||
export const uiSlice = createSlice({ | ||
name: "ui", | ||
initialState, | ||
|
||
// synchronous reducers | ||
reducers: { | ||
setDecimalSeparator: (state: UiState, action: PayloadAction<string>) => { | ||
state.decimalSeparator = action.payload; | ||
}, | ||
setThousandsSeparator: (state: UiState, action: PayloadAction<string>) => { | ||
state.thousandsSeparator = action.payload; | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters