Skip to content

Commit

Permalink
store cc values into sessionStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
genbs committed Feb 10, 2023
1 parent c968b96 commit af45341
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/state.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
const ccValues = JSON.parse(
sessionStorage.getItem('hydra-midi_ccValues') || '{}'
)

const ccValuesHandler = {
set() {
sessionStorage.setItem('hydra-midi_ccValues', JSON.stringify(ccValues))
return Reflect.set(...arguments)
},
}

export default {
/** @type {Record<string, number>} */
ccValues: {},
ccValues: new Proxy(ccValues, ccValuesHandler),

/** @type {Map<string, number>} */
playingNotes: new Map(),
Expand Down

0 comments on commit af45341

Please sign in to comment.