Skip to content

Commit

Permalink
Change SequenceTracker from default to named export
Browse files Browse the repository at this point in the history
  • Loading branch information
iansan5653 committed Oct 10, 2023
1 parent d1ee0b9 commit b0728e0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pages/hotkey_mapper.html
Expand Up @@ -47,13 +47,13 @@ <h1 id="app-name">Hotkey Code</h1>

<script type="module">
import {eventToHotkeyString} from '../dist/index.js'
import sequenceTracker, {SEQUENCE_DELIMITER} from '../dist/sequence.js'
import {SEQUENCE_DELIMITER, SequenceTracker} from '../dist/sequence.js'

const hotkeyCodeElement = document.getElementById('hotkey-code')
const sequenceStatusElement = document.getElementById('sequence-status')
const resetButtonElement = document.getElementById('reset-button')

const sequenceTracker = new sequenceTracker({
const SequenceTracker = new SequenceTracker({
onReset() {
sequenceStatusElement.hidden = true
}
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
@@ -1,6 +1,6 @@
import {Leaf, RadixTrie} from './radix-trie'
import {fireDeterminedAction, expandHotkeyToEdges, isFormField} from './utils'
import SequenceTracker from './sequence'
import {SequenceTracker} from './sequence'
import {eventToHotkeyString} from './hotkey'

export * from './hotkey'
Expand Down
2 changes: 1 addition & 1 deletion src/sequence.ts
Expand Up @@ -14,7 +14,7 @@ const sequenceBrand = Symbol('sequence')
*/
export type NormalizedSequenceString = string & {[sequenceBrand]: true}

export default class SequenceTracker {
export class SequenceTracker {
static readonly CHORD_TIMEOUT = 1500

private _path: readonly NormalizedHotkeyString[] = []
Expand Down

0 comments on commit b0728e0

Please sign in to comment.