Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.
This repository was archived by the owner on Oct 31, 2023. It is now read-only.

Immutable Stacks or ability to easily copy a stack #13

@mmmries

Description

@mmmries

I have a project where I would like to setup a reference stack and then make a few different stacks that differ in only a small way from the reference stack. For instance:

stack = Middleware::Builder.new do
  use Trace, "A"
  use Trace, "B"
end

stack2 = stack.dup
stack2.insert_after(2, Trace, "C")

stack2.call
--> A
--> B
--> C
<-- C
<-- B
<-- A

But currently ater I run the above code and I call stack.run, it gives me the same output that stack2 gave me.

If I open a pull request to fix this would you be open to supporting this feature?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions