Skip to content

Commit a2ccaae

Browse files
Rename valueFactory -> initialValueFactory
1 parent 39da5b1 commit a2ccaae

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/Components/Components/src/CascadingValueServiceCollectionExtensions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ public static class CascadingValueServiceCollectionExtensions
1717
/// </summary>
1818
/// <typeparam name="TValue">The value type.</typeparam>
1919
/// <param name="serviceCollection">The <see cref="IServiceCollection"/>.</param>
20-
/// <param name="valueFactory">A callback that supplies a fixed value within each service provider scope.</param>
20+
/// <param name="initialValueFactory">A callback that supplies a fixed value within each service provider scope.</param>
2121
/// <returns>The <see cref="IServiceCollection"/>.</returns>
2222
public static IServiceCollection AddCascadingValue<TValue>(
23-
this IServiceCollection serviceCollection, Func<IServiceProvider, TValue> valueFactory)
24-
=> serviceCollection.AddScoped<ICascadingValueSupplier>(sp => new CascadingValueSource<TValue>(() => valueFactory(sp), isFixed: true));
23+
this IServiceCollection serviceCollection, Func<IServiceProvider, TValue> initialValueFactory)
24+
=> serviceCollection.AddScoped<ICascadingValueSupplier>(sp => new CascadingValueSource<TValue>(() => initialValueFactory(sp), isFixed: true));
2525

2626
/// <summary>
2727
/// Adds a cascading value to the <paramref name="serviceCollection"/>. This is equivalent to having
@@ -30,11 +30,11 @@ public static IServiceCollection AddCascadingValue<TValue>(
3030
/// <typeparam name="TValue">The value type.</typeparam>
3131
/// <param name="serviceCollection">The <see cref="IServiceCollection"/>.</param>
3232
/// <param name="name">A name for the cascading value. If set, <see cref="CascadingParameterAttribute"/> can be configured to match based on this name.</param>
33-
/// <param name="valueFactory">A callback that supplies a fixed value within each service provider scope.</param>
33+
/// <param name="initialValueFactory">A callback that supplies a fixed value within each service provider scope.</param>
3434
/// <returns>The <see cref="IServiceCollection"/>.</returns>
3535
public static IServiceCollection AddCascadingValue<TValue>(
36-
this IServiceCollection serviceCollection, string name, Func<IServiceProvider, TValue> valueFactory)
37-
=> serviceCollection.AddScoped<ICascadingValueSupplier>(sp => new CascadingValueSource<TValue>(name, () => valueFactory(sp), isFixed: true));
36+
this IServiceCollection serviceCollection, string name, Func<IServiceProvider, TValue> initialValueFactory)
37+
=> serviceCollection.AddScoped<ICascadingValueSupplier>(sp => new CascadingValueSource<TValue>(name, () => initialValueFactory(sp), isFixed: true));
3838

3939
/// <summary>
4040
/// Adds a cascading value to the <paramref name="serviceCollection"/>. This is equivalent to having

src/Components/Components/src/CascadingValueSource.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,20 @@ public CascadingValueSource(string name, TValue value, bool isFixed) : this(valu
4848
/// <summary>
4949
/// Constructs an instance of <see cref="CascadingValueSource{TValue}"/>.
5050
/// </summary>
51-
/// <param name="valueFactory">A callback that produces the initial value when first required.</param>
51+
/// <param name="initialValueFactory">A callback that produces the initial value when first required.</param>
5252
/// <param name="isFixed">A flag to indicate whether the value is fixed. If false, all receipients will subscribe for update notifications, which you can issue by calling <see cref="NotifyChangedAsync()"/>. These subscriptions come at a performance cost, so if the value will not change, set <paramref name="isFixed"/> to true.</param>
53-
public CascadingValueSource(Func<TValue> valueFactory, bool isFixed) : this(isFixed)
53+
public CascadingValueSource(Func<TValue> initialValueFactory, bool isFixed) : this(isFixed)
5454
{
55-
_initialValueFactory = valueFactory;
55+
_initialValueFactory = initialValueFactory;
5656
}
5757

5858
/// <summary>
5959
/// Constructs an instance of <see cref="CascadingValueSource{TValue}"/>.
6060
/// </summary>
6161
/// <param name="name">A name for the cascading value. If set, <see cref="CascadingParameterAttribute"/> can be configured to match based on this name.</param>
62-
/// <param name="valueFactory">A callback that produces the initial value when first required.</param>
62+
/// <param name="initialValueFactory">A callback that produces the initial value when first required.</param>
6363
/// <param name="isFixed">A flag to indicate whether the value is fixed. If false, all receipients will subscribe for update notifications, which you can issue by calling <see cref="NotifyChangedAsync()"/>. These subscriptions come at a performance cost, so if the value will not change, set <paramref name="isFixed"/> to true.</param>
64-
public CascadingValueSource(string name, Func<TValue> valueFactory, bool isFixed) : this(valueFactory, isFixed)
64+
public CascadingValueSource(string name, Func<TValue> initialValueFactory, bool isFixed) : this(initialValueFactory, isFixed)
6565
{
6666
ArgumentNullException.ThrowIfNull(name);
6767
_name = name;

src/Components/Components/src/PublicAPI.Unshipped.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Microsoft.AspNetCore.Components.CascadingParameterInfo.CascadingParameterInfo()
88
Microsoft.AspNetCore.Components.CascadingParameterInfo.PropertyName.get -> string!
99
Microsoft.AspNetCore.Components.CascadingParameterInfo.PropertyType.get -> System.Type!
1010
Microsoft.AspNetCore.Components.CascadingValueSource<TValue>
11-
Microsoft.AspNetCore.Components.CascadingValueSource<TValue>.CascadingValueSource(string! name, System.Func<TValue>! valueFactory, bool isFixed) -> void
11+
Microsoft.AspNetCore.Components.CascadingValueSource<TValue>.CascadingValueSource(string! name, System.Func<TValue>! initialValueFactory, bool isFixed) -> void
1212
Microsoft.AspNetCore.Components.CascadingValueSource<TValue>.CascadingValueSource(string! name, TValue value, bool isFixed) -> void
13-
Microsoft.AspNetCore.Components.CascadingValueSource<TValue>.CascadingValueSource(System.Func<TValue>! valueFactory, bool isFixed) -> void
13+
Microsoft.AspNetCore.Components.CascadingValueSource<TValue>.CascadingValueSource(System.Func<TValue>! initialValueFactory, bool isFixed) -> void
1414
Microsoft.AspNetCore.Components.CascadingValueSource<TValue>.CascadingValueSource(TValue value, bool isFixed) -> void
1515
Microsoft.AspNetCore.Components.CascadingValueSource<TValue>.NotifyChangedAsync() -> System.Threading.Tasks.Task!
1616
Microsoft.AspNetCore.Components.CascadingValueSource<TValue>.NotifyChangedAsync(TValue newValue) -> System.Threading.Tasks.Task!
@@ -88,9 +88,9 @@ override Microsoft.AspNetCore.Components.EventCallback.Equals(object? obj) -> bo
8888
override Microsoft.AspNetCore.Components.EventCallback<TValue>.GetHashCode() -> int
8989
override Microsoft.AspNetCore.Components.EventCallback<TValue>.Equals(object? obj) -> bool
9090
static Microsoft.AspNetCore.Components.SupplyParameterFromQueryProviderServiceCollectionExtensions.AddSupplyValueFromQueryProvider(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
91-
static Microsoft.Extensions.DependencyInjection.CascadingValueServiceCollectionExtensions.AddCascadingValue<TValue>(this Microsoft.Extensions.DependencyInjection.IServiceCollection! serviceCollection, string! name, System.Func<System.IServiceProvider!, TValue>! valueFactory) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
91+
static Microsoft.Extensions.DependencyInjection.CascadingValueServiceCollectionExtensions.AddCascadingValue<TValue>(this Microsoft.Extensions.DependencyInjection.IServiceCollection! serviceCollection, string! name, System.Func<System.IServiceProvider!, TValue>! initialValueFactory) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
9292
static Microsoft.Extensions.DependencyInjection.CascadingValueServiceCollectionExtensions.AddCascadingValue<TValue>(this Microsoft.Extensions.DependencyInjection.IServiceCollection! serviceCollection, System.Func<System.IServiceProvider!, Microsoft.AspNetCore.Components.CascadingValueSource<TValue>!>! sourceFactory) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
93-
static Microsoft.Extensions.DependencyInjection.CascadingValueServiceCollectionExtensions.AddCascadingValue<TValue>(this Microsoft.Extensions.DependencyInjection.IServiceCollection! serviceCollection, System.Func<System.IServiceProvider!, TValue>! valueFactory) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
93+
static Microsoft.Extensions.DependencyInjection.CascadingValueServiceCollectionExtensions.AddCascadingValue<TValue>(this Microsoft.Extensions.DependencyInjection.IServiceCollection! serviceCollection, System.Func<System.IServiceProvider!, TValue>! initialValueFactory) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
9494
static Microsoft.Extensions.DependencyInjection.CascadingValueServiceCollectionExtensions.TryAddCascadingValue<TValue>(this Microsoft.Extensions.DependencyInjection.IServiceCollection! serviceCollection, string! name, System.Func<System.IServiceProvider!, TValue>! valueFactory) -> void
9595
static Microsoft.Extensions.DependencyInjection.CascadingValueServiceCollectionExtensions.TryAddCascadingValue<TValue>(this Microsoft.Extensions.DependencyInjection.IServiceCollection! serviceCollection, System.Func<System.IServiceProvider!, Microsoft.AspNetCore.Components.CascadingValueSource<TValue>!>! sourceFactory) -> void
9696
static Microsoft.Extensions.DependencyInjection.CascadingValueServiceCollectionExtensions.TryAddCascadingValue<TValue>(this Microsoft.Extensions.DependencyInjection.IServiceCollection! serviceCollection, System.Func<System.IServiceProvider!, TValue>! valueFactory) -> void

0 commit comments

Comments
 (0)