|
Last change
on this file since a762898 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
811 bytes
|
| Line | |
|---|
| 1 | import { createSlice } from '@reduxjs/toolkit';
|
|---|
| 2 | import { castDraft } from 'immer';
|
|---|
| 3 | var initialState = {
|
|---|
| 4 | radiusAxis: {},
|
|---|
| 5 | angleAxis: {}
|
|---|
| 6 | };
|
|---|
| 7 | var polarAxisSlice = createSlice({
|
|---|
| 8 | name: 'polarAxis',
|
|---|
| 9 | initialState,
|
|---|
| 10 | reducers: {
|
|---|
| 11 | addRadiusAxis(state, action) {
|
|---|
| 12 | state.radiusAxis[action.payload.id] = castDraft(action.payload);
|
|---|
| 13 | },
|
|---|
| 14 | removeRadiusAxis(state, action) {
|
|---|
| 15 | delete state.radiusAxis[action.payload.id];
|
|---|
| 16 | },
|
|---|
| 17 | addAngleAxis(state, action) {
|
|---|
| 18 | state.angleAxis[action.payload.id] = castDraft(action.payload);
|
|---|
| 19 | },
|
|---|
| 20 | removeAngleAxis(state, action) {
|
|---|
| 21 | delete state.angleAxis[action.payload.id];
|
|---|
| 22 | }
|
|---|
| 23 | }
|
|---|
| 24 | });
|
|---|
| 25 | export var {
|
|---|
| 26 | addRadiusAxis,
|
|---|
| 27 | removeRadiusAxis,
|
|---|
| 28 | addAngleAxis,
|
|---|
| 29 | removeAngleAxis
|
|---|
| 30 | } = polarAxisSlice.actions;
|
|---|
| 31 | export var polarAxisReducer = polarAxisSlice.reducer; |
|---|
Note:
See
TracBrowser
for help on using the repository browser.