Skip to content

Instantly share code, notes, and snippets.

@mfbx9da4
Created December 31, 2020 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mfbx9da4/dff0861838657ff2ad4a2c4300ad6b85 to your computer and use it in GitHub Desktop.
Save mfbx9da4/dff0861838657ff2ad4a2c4300ad6b85 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'Scroll view',
initial: 'chat_closed',
context: {
dog: null
},
states: {
chat_closed: {
on: {
open: 'chat_open'
}
},
chat_open: {
on: {
render_messages: 'now'
}
},
now: {
on: {
scroll_up: 'scrolling'
}
},
scrolling: {
on: {
inside_load_more_threshold: 'load_more_inside',
load_more_at_0: 'load_more_at_0'
}
},
load_more_inside: {
scrollTop: 100,
height: 800,
scrollHeight: 800,
on: {
render_messages: 'scrolling'
}
},
load_more_at_0: {
scrollTop: 0,
height: 800,
scrollHeight: 800,
on: {
render_messages: 'keep_scroll_in_place'
}
},
keep_scroll_in_place: {}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment