fix purity of 'withState' so it returns a new pattern
This commit is contained in:
parent
cbcb25b063
commit
694162a7b1
1 changed files with 1 additions and 4 deletions
|
|
@ -98,10 +98,7 @@ export class Pattern {
|
||||||
|
|
||||||
// runs func on query state
|
// runs func on query state
|
||||||
withState(func) {
|
withState(func) {
|
||||||
return this.withHaps((haps, state) => {
|
return new Pattern((state) => this.query(func(state)));
|
||||||
func(state);
|
|
||||||
return haps;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue