Skip to content

Instantly share code, notes, and snippets.

@kamescg
Created November 4, 2019 17:33
Show Gist options
  • Save kamescg/bf48a7b804d7fc0dd05b6786aa9ff999 to your computer and use it in GitHub Desktop.
Save kamescg/bf48a7b804d7fc0dd05b6786aa9ff999 to your computer and use it in GitHub Desktop.
StorageInsert.3box.js
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