Skip to content

Instantly share code, notes, and snippets.

@ShMcK
Created July 20, 2018 04:10
Show Gist options
  • Save ShMcK/13b90af68ac7e74f52b7e65c4844b464 to your computer and use it in GitHub Desktop.
Save ShMcK/13b90af68ac7e74f52b7e65c4844b464 to your computer and use it in GitHub Desktop.
xstateful-react-cond
import AlarmMachine from './statefulAlarmMachine'
const Ringing = () => (
<AlarmMachine cond={({ state, exstate )} => (
state === 'Ringing' && exstate.ringCount < 5
)}>
<PlayRinging />
</AlarmMachine>
)
@agamrafaeli
Copy link

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 }) => (.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment