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

Get writer index from callback #314

Open
fxpar opened this issue Apr 14, 2024 · 0 comments
Open

Get writer index from callback #314

fxpar opened this issue Apr 14, 2024 · 0 comments

Comments

@fxpar
Copy link

fxpar commented Apr 14, 2024

Hi,
I have multiple writers (looping on all characters in an expression).
How to get the index of the current writer when there is a mistake?

writer[i].quiz({
	onMistake: function(strokeData) {
    		console.log('currentWriterIndex:' + ???);
	},

I did get something with writer.findIndex(({_char}) => _char === strokeData.character); but it won't work with expressions with repetitive characters like 哥哥 or 弟弟.

Thanks for your help.

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

1 participant