(
state: NodeState,
duration?: number,
timing: TimingFunction = easeInOutCubic,
)
| 1813 | timing?: TimingFunction, |
| 1814 | ): ThreadGenerator; |
| 1815 | public applyState( |
| 1816 | state: NodeState, |
| 1817 | duration?: number, |
| 1818 | timing: TimingFunction = easeInOutCubic, |
| 1819 | ): ThreadGenerator | void { |
| 1820 | if (duration === undefined) { |
| 1821 | for (const key in state) { |
| 1822 | const signal = this.signalByKey(key); |
| 1823 | if (signal) { |
| 1824 | signal(state[key]); |
| 1825 | } |
| 1826 | } |
| 1827 | } |
| 1828 | |
| 1829 | const tasks: ThreadGenerator[] = []; |
| 1830 | for (const key in state) { |
| 1831 | const signal = this.signalByKey(key); |
| 1832 | if (state[key] !== signal.context.raw()) { |
| 1833 | tasks.push(signal(state[key], duration!, timing)); |
| 1834 | } |
| 1835 | } |
| 1836 | |
| 1837 | return all(...tasks); |
| 1838 | } |
| 1839 | |
| 1840 | /** |
| 1841 | * Push a snapshot of the node's current state onto the node's state stack. |
no test coverage detected