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
|
||||
withState(func) {
|
||||
return this.withHaps((haps, state) => {
|
||||
func(state);
|
||||
return haps;
|
||||
});
|
||||
return new Pattern((state) => this.query(func(state)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue