Created
July 20, 2018 04:10
-
-
Save ShMcK/13b90af68ac7e74f52b7e65c4844b464 to your computer and use it in GitHub Desktop.
xstateful-react-cond
This file contains hidden or 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
import AlarmMachine from './statefulAlarmMachine' | |
const Ringing = () => ( | |
<AlarmMachine cond={({ state, exstate )} => ( | |
state === 'Ringing' && exstate.ringCount < 5 | |
)}> | |
<PlayRinging /> | |
</AlarmMachine> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't want to be a nitpicker but I think that in line 4 you have mixed up order of closing parentheses and brackets. I think it should be
cond={({ state, exstate }) => (
.