Created
November 4, 2019 17:33
-
-
Save kamescg/bf48a7b804d7fc0dd05b6786aa9ff999 to your computer and use it in GitHub Desktop.
StorageInsert.3box.js
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
import React, { useEffect } from 'react'; | |
import { BoxInject } from '3box-ui-state' | |
const StorageInsert = ({ box, ...props }) => { | |
useEffect(() => { | |
if (props.space && props.index && props.delta && props.data) { | |
box.insert({ | |
address: props.address, | |
space: props.space, | |
access: 'public', | |
index: props.index, | |
key: props.delta, | |
value: props.data, | |
}) | |
} | |
}, [props.data]) | |
return null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment