diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2021-04-26 22:56:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-26 22:56:40 -0700 |
commit | 17e1f8c7b67a36c4e9384b7c7b930b68c8bfd6f4 (patch) | |
tree | cc596678a30c0c50d1a99831e30839cd964ed501 /modern/src/store/drivers.js | |
parent | 047bf86480e2b3e215c13df2af0da456a664b507 (diff) | |
parent | 127a2628b61b0a151eb5225af7ecaf483f907665 (diff) | |
download | trackermap-web-17e1f8c7b67a36c4e9384b7c7b930b68c8bfd6f4.tar.gz trackermap-web-17e1f8c7b67a36c4e9384b7c7b930b68c8bfd6f4.tar.bz2 trackermap-web-17e1f8c7b67a36c4e9384b7c7b930b68c8bfd6f4.zip |
Merge pull request #844 from mail2bishnoi/stores
Created mostly used stores
Diffstat (limited to 'modern/src/store/drivers.js')
-rw-r--r-- | modern/src/store/drivers.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modern/src/store/drivers.js b/modern/src/store/drivers.js new file mode 100644 index 00000000..63522d78 --- /dev/null +++ b/modern/src/store/drivers.js @@ -0,0 +1,16 @@ +import { createSlice } from '@reduxjs/toolkit'; + +const { reducer, actions } = createSlice({ + name: 'drivers', + initialState: { + items: {}, + }, + reducers: { + update(state, action) { + action.payload.forEach(item => state.items[item['id']] = item); + }, + } +}); + +export { actions as driversActions }; +export { reducer as driversReducer }; |