Squashed commit of the following:
commit 822f2d6527d161a29ed9d2603ae73c416ec04c37 Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 15:33:17 2020 -0500 Squashed commit of the following: commit 8853f3122e77188a987b5a2585fc61aa137fddab Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 15:24:23 2020 -0500 Squashed commit of the following: commit 47b74abadfd125b90c883d43786149a51bb7cdba Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 14:15:03 2020 -0500 custom rc-slider style and include commit b2d1161cbc7eabb6a2c512606b66104084c25754 Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 14:14:45 2020 -0500 include rc-slider package commit fca611edc959935b09dcd70cfaa737680f22d559 Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 03:09:47 2020 -0500 add styled-components commit 86bec44f1ea5f631107aad0c561a5788728946c8 Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 01:13:09 2020 -0500 added timbre2 to App commit d1c275b9915861fde8ca9225e5dcb591c707949d Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 01:13:00 2020 -0500 updated parameterSlice with correct ID's commit 3e694c135722c4c63c489e6c2691b18fea4f977a Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 01:12:30 2020 -0500 added timbre reducer to store commit 251693a3fd35aca039de51dda79a17e4154afb89 Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 01:12:11 2020 -0500 added support for seperate timbres commit a2b24c1e6f7cf1b95bfeffb828418319932658ec Author: [poww10s] <[theironminer@gmail.com]> Date: Thu Nov 19 01:11:54 2020 -0500 added timbreSlice
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
import { createSlice, createEntityAdapter } from '@reduxjs/toolkit';
|
||||
|
||||
const timbreAdapter = createEntityAdapter({});
|
||||
|
||||
const timbreSlice = createSlice({
|
||||
name: 'timbre',
|
||||
initialState: timbreAdapter.getInitialState({
|
||||
ids: ['timbre1', 'timbre2', 'vocoder', 'effects', 'arpeggiator'],
|
||||
entities: {
|
||||
'timbre1': {
|
||||
id: 'timbre1',
|
||||
vco1: 'vco1',
|
||||
vco2: 'vco2',
|
||||
mixer: 'mixer1',
|
||||
pitch: 'pitch1',
|
||||
filter: 'filter1',
|
||||
eg1: 'eg1',
|
||||
amp: 'amp1',
|
||||
eg2: 'eg2',
|
||||
lfo1: 'lfo1',
|
||||
lfo2: 'lfo2',
|
||||
patches: 'patches1',
|
||||
},
|
||||
'timbre2': {
|
||||
id: 'timbre2',
|
||||
vco1: 'vco3',
|
||||
vco2: 'vco4',
|
||||
mixer: 'mixer2',
|
||||
pitch: 'pitch2',
|
||||
filter: 'filter2',
|
||||
eg1: 'eg3',
|
||||
amp: 'amp2',
|
||||
eg2: 'eg4',
|
||||
lfo1: 'lfo3',
|
||||
lfo2: 'lfo4',
|
||||
patches: 'patches2',
|
||||
},
|
||||
},
|
||||
}),
|
||||
reducers: {
|
||||
timbreAdded: timbreAdapter.addOne,
|
||||
timbreUpdated: timbreAdapter.updateOne,
|
||||
},
|
||||
});
|
||||
|
||||
export const {
|
||||
selectById,
|
||||
selectAll,
|
||||
selectEntities,
|
||||
selectIds,
|
||||
} = timbreAdapter.getSelectors((state) => state.timbres);
|
||||
|
||||
export const { timbreAdded, timbreUpdated } = timbreSlice.actions;
|
||||
|
||||
export default timbreSlice.reducer;
|
||||
Reference in New Issue
Block a user