use state query in repl

+ move locations to context
This commit is contained in:
Felix Roos 2022-02-25 20:10:49 +01:00
parent 29bdfb2d90
commit f1362b1c94
5 changed files with 25 additions and 23 deletions

View file

@ -81,9 +81,9 @@ function useRepl({ tune, defaultSynth, autolink = true, onEvent }: any) {
[onEvent]
),
onQuery: useCallback(
(span) => {
(state) => {
try {
return pattern?.query(span) || [];
return pattern?.query(state) || [];
} catch (err: any) {
err.message = 'query error: ' + err.message;
setError(err);