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 (#1151)

I created #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 #1144
  • Loading branch information
abhinav committed Feb 6, 2024
1 parent 810e52c commit e7a70af
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 e7a70af

Please sign in to comment.