Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add TypeScript #66

Open
aqandrew opened this issue Feb 10, 2024 · 5 comments
Open

add TypeScript #66

aqandrew opened this issue Feb 10, 2024 · 5 comments

Comments

@aqandrew
Copy link
Owner

aqandrew commented Feb 10, 2024

custom objects like notes, measures, and durations are unwieldy

@bEluga0000
Copy link

can u please explain what the issues is .

@aqandrew
Copy link
Owner Author

Sure. In reducers.js, there are some object definitions that represent tracks, measures, durations, and notes:

export const initialAppState = {
selectedTrackNumber: 0,
selectedMeasureNumber: 0,
selectedDurationId: undefined,
selectedStringNumber: 0,
// https://redux.js.org/recipes/structuring-reducers/normalizing-state-shape
tracks: {
byId: {},
allIds: [],
},
measures: {
byId: {},
allIds: [],
},
durations: {
byId: {},
allIds: [],
},
notes: {
byId: {},
allIds: [],
},
};
export const defaultMeasureOptions = {
timeSignature: {
beatsPerMeasure: 4,
beatUnit: 4,
},
keySignature: {
tonic: 'C',
isMajor: true,
},
durations: [],
};
export const defaultDurationOptions = {
isRest: false,
length: 1 / 4,
isDotted: false,
notes: [],
};

I'd like to add TypeScript to this project so that I can have more confidence in manipulating these object properties. I also find VS Code's Intellisense for TypeScript very helpful.

@bEluga0000
Copy link

okay i will try to move this project to typescript

@aqandrew
Copy link
Owner Author

Please don't do that. For the time being this is just an educational project for myself, so I'm not accepting unsolicited PRs

@bEluga0000
Copy link

okay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants