Skip to content

Instantly share code, notes, and snippets.

@FeliciousX
FeliciousX / machine.js
Created October 12, 2020 04:27
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@FeliciousX
FeliciousX / machine.js
Last active September 18, 2020 05:48
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
initial: 'idle',
context: {
cursorStart: {
x: 0,
y: 0
},
item: null,
siblingAbove: null,
siblingBelow: null,
@FeliciousX
FeliciousX / machine.js
Last active September 3, 2020 06:00
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'content',
context: {
itemData: null,
hoverOverItem: null
},
initial: 'idle',
states: {
idle: {
entry: 'clearContext',
@FeliciousX
FeliciousX / machine.js
Last active June 9, 2020 18:40
Generated by XState Viz: https://xstate.js.org/viz
const editingVisualState = {
initial: 'loading',
states: {
loading: {
after: {
3000: [
{ target: 'idle' }
]
}
},
@FeliciousX
FeliciousX / machine.js
Last active May 12, 2020 03:20
Generated by XState Viz: https://xstate.js.org/viz
const emailVerificationMachine = Machine({
id: 'emailVerification',
initial: 'idle',
states: {
idle: {
on: { SEND_EMAIL: 'sending' }
},
sending: {
invoke: {
src: 'sendVerification',
@FeliciousX
FeliciousX / esnextbin.md
Created June 9, 2017 10:45
esnextbin sketch
@FeliciousX
FeliciousX / esnextbin.md
Created May 2, 2017 07:18
esnextbin sketch
@FeliciousX
FeliciousX / esnextbin.md
Created April 22, 2017 18:33
esnextbin sketch
@FeliciousX
FeliciousX / transformSinks.js
Last active April 22, 2017 08:45
CycleJS Sink helper function
/**
pretty straightforward implementatation.
( Stream -> Stream ) -> string -> HOC
HOC is a higher order component where the Signature is always
(sources -> sinks) -> sources -> sinks
**/
function transformSink( fn, key ) {
return ( Component ) => ( sources ) => {
const sinks = Component( sources )
@FeliciousX
FeliciousX / esnextbin.md
Created April 21, 2017 09:06
esnextbin sketch