Let's use our DReddit JS Object, and the `EmbarkJS` API to interact with our contract and IPFS. While we update our files, notice how Embark watches and recompiles any asset we modify when we save the changes. Navigate to the `app/js/components` folder and follow along from there:
> Both EmbarkJS and web3 are normally imported whenever there's a need to interact with web3 technologies. You'll see these imports present in both `App.js` and `Post.js`
2. Update the `handleClick` event that is triggered when you press the `Publish` button. This will save the post on IPFS, and invoke our contract. We need to obtain a gas estimate and add our post using the contract's `create` function.
> Notice that we added 1000 wei to the estimated gas. There are situations where the estimated gas is incorrect depending on the state of the contract, or if you're deleting items from an array. Adding some extra wei helps avoid running into unexpected Out of Gas exceptions.
> Notice that we aren't using `await` here. It's not good practice to use `await` inside a loop. It's better to load all the promises inside an array, and then, call `Promise.all()` on this array.