0a39cf6b22
* add redent function when verifying snapshots This allows us not to care about the correct amount of spaces and always produces a clean output. * make the container the parent of the wrapper element * drop the visible prop on the Portal component * drop visible prop on Portal component + Also cleanup a little bit * expose the RenderStrategy * implement Transition component in Vue * expose Transition component * add Transitions to the Dialog example
21 lines
383 B
TypeScript
21 lines
383 B
TypeScript
import { disposables } from '../utils/disposables'
|
|
|
|
export function reportChanges<TType>(key: () => TType, onChange: (value: TType) => void) {
|
|
let d = disposables()
|
|
|
|
let previous: TType
|
|
|
|
function track() {
|
|
let next = key()
|
|
if (previous !== next) {
|
|
previous = next
|
|
onChange(next)
|
|
}
|
|
d.requestAnimationFrame(track)
|
|
}
|
|
|
|
track()
|
|
|
|
return d.dispose
|
|
}
|