Skip to content

ipfs@0.41 update: option 1 #382

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
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
17 changes: 14 additions & 3 deletions src/tutorials/0005-regular-files-api/03.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
const validate = async (result, ipfs) => {
const uploadedFiles = window.uploadedFiles || false
const expectedResult = []

const expectedResult = await ipfs.add(window.uploadedFiles)
for await (const result of ipfs.add(window.uploadedFiles)) {
expectedResult.push(result)
}

if (!result) {
return {
Expand Down Expand Up @@ -48,7 +51,11 @@ const validate = async (result, ipfs) => {

const code = `/* global ipfs */
const run = async (files) => {
const result = // Place your code to add a file or files here
const result = []

for await (const resultPart of ) {
// Place your code to add a file or files here and on the for await of loop
}

return result
}
Expand All @@ -57,7 +64,11 @@ return run

const solution = `/* global ipfs */
const run = async (files) => {
const result = await ipfs.add(files)
const result = []

for await (const resultPart of ipfs.add(files)) {
result.push(resultPart)
}

return result
}
Expand Down