Skip to content

ipfs@0.41 update: option 2 #383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"highlight.js": "^9.12.0",
"ipfs": "^0.41.0",
"ipfs-css": "^0.6.0",
"it-all": "^1.0.1",
"meta-marked": "^0.4.2",
"monaco-editor": "^0.6.1",
"new-github-issue-url": "^0.2.1",
Expand Down
14 changes: 10 additions & 4 deletions src/tutorials/0005-regular-files-api/03.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import all from 'it-all'

const validate = async (result, ipfs) => {
const uploadedFiles = window.uploadedFiles || false

const expectedResult = await ipfs.add(window.uploadedFiles)
const expectedResult = await all(ipfs.add(window.uploadedFiles))

if (!result) {
return {
Expand Down Expand Up @@ -47,24 +49,28 @@ const validate = async (result, ipfs) => {
}

const code = `/* global ipfs */
const all = require('it-all')

const run = async (files) => {
const result = // Place your code to add a file or files here
const result = all() // Place your code to add a file or files here

return result
}
return run
`

const solution = `/* global ipfs */
const all = require('it-all')

const run = async (files) => {
const result = await ipfs.add(files)
const result = await all(ipfs.add(files))

return result
}
return run
`

const modules = { cids: require('cids') }
const modules = { 'it-all': require('it-all') }

const options = {
overrideErrors: true
Expand Down