fix purity of 'withState' so it returns a new pattern

This commit is contained in:
Alex McLean
2025-10-08 14:13:33 +01:00
parent cbcb25b063
commit 694162a7b1
+1 -4
View File
@@ -98,10 +98,7 @@ export class Pattern {
// runs func on query state
withState(func) {
return this.withHaps((haps, state) => {
func(state);
return haps;
});
return new Pattern((state) => this.query(func(state)));
}
/**