Last active
September 6, 2021 10:39
-
-
Save luninr/27ab323126ff889b714b673acf491eb7 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const consentMachine = Machine({ | |
id: 'consent', | |
initial: 'init', | |
context: { | |
organizationId: 'orgId', | |
emailOrPhone: 'email@orphone.se', | |
}, | |
states: { | |
init: { | |
on: { | |
FREELY_GIVEN: 'optIn', | |
LEGITIMATE_INTEREST: 'optIn', | |
UNSUBSCRIBE: 'optOut', | |
}, | |
}, | |
optIn: { | |
on: { | |
FREELY_GIVEN: 'optIn', | |
LEGITIMATE_INTEREST: 'optIn', | |
UNSUBSCRIBE: 'optOut', | |
} | |
}, | |
optOut: { | |
on: { | |
FREELY_GIVEN: 'optIn', | |
LEGITIMATE_INTEREST: 'optOut', | |
UNSUBSCRIBE: 'optOut', | |
} | |
}, | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment