Skip to content

Commit 448e431

Browse files
authored
Use modern subscribe syntax (#1992)
1 parent 818e4f2 commit 448e431

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

docs/guide/instrumentation.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ Setting `use_deprecated_instrumentation_name` configures the event name. If `fal
2323
Subscribe to the event:
2424

2525
```ruby
26-
ActiveSupport::Notifications.subscribe("render.view_component") do |*args| # or !render.view_component
27-
event = ActiveSupport::Notifications::Event.new(*args)
26+
ActiveSupport::Notifications.subscribe("render.view_component") do |event| # or !render.view_component
2827
event.name # => "render.view_component"
2928
event.payload # => { name: "MyComponent", identifier: "/Users/mona/project/app/components/my_component.rb" }
3029
end

0 commit comments

Comments
 (0)