Skip to content

Commit

Permalink
doc(Decorate): Explain that decorators can not add new values to the …
Browse files Browse the repository at this point in the history
…graph

I created uber-go#1144 because I was not sure whether a decorator
could add new values to the graph.

This clarifies the behavior.
We already have tests to verify this behavior.

Resolves uber-go#1144
  • Loading branch information
abhinav committed Feb 6, 2024
1 parent 810e52c commit cd087f8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions decorate.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ import (
// return r
// }),
//
// Decorators can not add new values to the graph,
// only modify or replace existing ones.
// Types returned by a decorator that are not already in the graph
// will be ignored.
//
// # Decorator scope
//
// Modifications made to the Fx graph with fx.Decorate are scoped to the
Expand Down

0 comments on commit cd087f8

Please sign in to comment.