feat(handles): validate connection

This commit is contained in:
moklick
2019-10-07 19:56:47 +02:00
parent 0e67f5fefa
commit ae1bb70882
7 changed files with 89 additions and 21 deletions
+6 -1
View File
@@ -9,6 +9,11 @@ export default({ data, styles }) => (
<Handle type="target" position="left" style={{ background: '#999' }} />
<div>{data.input}</div>
<input onChange={(e) => data.onChange(e.target.value, data)} />
<Handle type="source" position="right" style={{ background: '#999' }} />
<Handle
type="source"
position="right"
style={{ background: '#999' }}
isValidConnection={connection => +connection.target % 2 === 0}
/>
</div>
);