* Checks if the current state matches the provided one. * * @param states - A state to check. * * @return `true` if the current state is the provided one.
( states: number | number[] )
| 39 | * @return `true` if the current state is the provided one. |
| 40 | */ |
| 41 | function is( states: number | number[] ): boolean { |
| 42 | return includes( toArray( states ), state ); |
| 43 | } |
| 44 | |
| 45 | return { set, is }; |
| 46 | } |