Skip to content

Commit 7c17aba

Browse files
Rename valueFactory -> initialValueFactory
1 parent a71c70d commit 7c17aba

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
@@ -16,11 +16,11 @@ public static class CascadingValueServiceCollectionExtensions
1616
/// </summary>
1717
/// <typeparam name="TValue">The value type.</typeparam>
1818
/// <param name="serviceCollection">The <see cref="IServiceCollection"/>.</param>
19-
/// <param name="valueFactory">A callback that supplies a fixed value within each service provider scope.</param>
19+
/// <param name="initialValueFactory">A callback that supplies a fixed value within each service provider scope.</param>
2020
/// <returns>The <see cref="IServiceCollection"/>.</returns>
2121
public static IServiceCollection AddCascadingValue<TValue>(
22-
this IServiceCollection serviceCollection, Func<IServiceProvider, TValue> valueFactory)
23-
=> serviceCollection.AddScoped<ICascadingValueSupplier>(sp => new CascadingValueSource<TValue>(() => valueFactory(sp), isFixed: true));
22+
this IServiceCollection serviceCollection, Func<IServiceProvider, TValue> initialValueFactory)
23+
=> serviceCollection.AddScoped<ICascadingValueSupplier>(sp => new CascadingValueSource<TValue>(() => initialValueFactory(sp), isFixed: true));
2424

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

3838
/// <summary>
3939
/// 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
@@ -10,9 +10,9 @@ Microsoft.AspNetCore.Components.CascadingParameterInfo.CascadingParameterInfo()
1010
Microsoft.AspNetCore.Components.CascadingParameterInfo.PropertyName.get -> string!
1111
Microsoft.AspNetCore.Components.CascadingParameterInfo.PropertyType.get -> System.Type!
1212
Microsoft.AspNetCore.Components.CascadingValueSource<TValue>
13-
Microsoft.AspNetCore.Components.CascadingValueSource<TValue>.CascadingValueSource(string! name, System.Func<TValue>! valueFactory, bool isFixed) -> void
13+
Microsoft.AspNetCore.Components.CascadingValueSource<TValue>.CascadingValueSource(string! name, System.Func<TValue>! initialValueFactory, bool isFixed) -> void
1414
Microsoft.AspNetCore.Components.CascadingValueSource<TValue>.CascadingValueSource(string! name, TValue value, bool isFixed) -> void
15-
Microsoft.AspNetCore.Components.CascadingValueSource<TValue>.CascadingValueSource(System.Func<TValue>! valueFactory, bool isFixed) -> void
15+
Microsoft.AspNetCore.Components.CascadingValueSource<TValue>.CascadingValueSource(System.Func<TValue>! initialValueFactory, bool isFixed) -> void
1616
Microsoft.AspNetCore.Components.CascadingValueSource<TValue>.CascadingValueSource(TValue value, bool isFixed) -> void
1717
Microsoft.AspNetCore.Components.CascadingValueSource<TValue>.NotifyChangedAsync() -> System.Threading.Tasks.Task!
1818
Microsoft.AspNetCore.Components.CascadingValueSource<TValue>.NotifyChangedAsync(TValue newValue) -> System.Threading.Tasks.Task!
@@ -98,9 +98,9 @@ override Microsoft.AspNetCore.Components.EventCallback<TValue>.Equals(object? ob
9898
override Microsoft.AspNetCore.Components.SupplyParameterFromQueryAttribute.Name.get -> string?
9999
override Microsoft.AspNetCore.Components.SupplyParameterFromQueryAttribute.Name.set -> void
100100
static Microsoft.AspNetCore.Components.SupplyParameterFromQueryProviderServiceCollectionExtensions.AddSupplyValueFromQueryProvider(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
101-
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!
101+
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!
102102
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!
103-
static Microsoft.Extensions.DependencyInjection.CascadingValueServiceCollectionExtensions.AddCascadingValue<TValue>(this Microsoft.Extensions.DependencyInjection.IServiceCollection! serviceCollection, System.Func<System.IServiceProvider!, TValue>! valueFactory) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
103+
static Microsoft.Extensions.DependencyInjection.CascadingValueServiceCollectionExtensions.AddCascadingValue<TValue>(this Microsoft.Extensions.DependencyInjection.IServiceCollection! serviceCollection, System.Func<System.IServiceProvider!, TValue>! initialValueFactory) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
104104
virtual Microsoft.AspNetCore.Components.NavigationManager.Refresh(bool forceReload = false) -> void
105105
virtual Microsoft.AspNetCore.Components.Rendering.ComponentState.DisposeAsync() -> System.Threading.Tasks.ValueTask
106106
virtual Microsoft.AspNetCore.Components.RenderTree.Renderer.AddPendingTask(Microsoft.AspNetCore.Components.Rendering.ComponentState? componentState, System.Threading.Tasks.Task! task) -> void

0 commit comments

Comments
 (0)