Skip to content
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

Custom step adapters documentation bug #129

Open
graudeejs opened this issue Nov 15, 2019 · 1 comment
Open

Custom step adapters documentation bug #129

graudeejs opened this issue Nov 15, 2019 · 1 comment
Labels

Comments

@graudeejs
Copy link

Describe the bug

In the documentation of dry-transaction section Custom step adapters there is a code snippet:

QUEUE = []

class MyStepAdapters < Dry::Transaction::StepAdapters
  register :enqueue, -> step, input, *args {
    # In a real app, this would push the operation into a background worker queue
    QUEUE << step.operation.call(input, *args)

    Dry::Monads.Success(input)
  }
end

However actual interface is different.

To Reproduce

Expected behavior

Code snippet in documentation needs to be updated to something like:

QUEUE = []

class MyStepAdapters < Dry::Transaction::StepAdapters
  register :enqueue, ->(operation, _options, args) {
    # In a real app, this would push the operation into a background worker queue
    QUEUE << operation.call(*args))

    Dry::Monads.Success(input)
  }
end

Also text describing interface (#call(step, input, *args)) needs to be updated accordingly.

Your environment

  • Affects my production application: NO
  • Ruby version: 2.6.3
  • OS: Linux/5.3.8-gentoo
@graudeejs graudeejs added the bug label Nov 15, 2019
@krisleech
Copy link

You can submit a PR for the docs by going to the page and clicking "Edit in Github" 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants