@@ -8,15 +8,16 @@ namespace Open.ChannelExtensions
88 /// A channel wrapper that takes the provided channel and transforms them on demand when being read.
99 /// </summary>
1010 /// <typeparam name="TWrite">Specifies the type of data that may be written to the channel.</typeparam>
11- /// <typeparam name="TRead">Specifies the type of data that may be read from the channel.</typeparam>
12- public class TransformChannel < TWrite , TRead > : Channel < TWrite , TRead >
11+ /// <typeparam name="TRead">Specifies the type of data read from the source channel.</typeparam>
12+ /// <typeparam name="TResult">Specifies the type of data that may be read from the channel.</typeparam>
13+ public class TransformChannel < TWrite , TRead , TResult > : Channel < TWrite , TResult >
1314 {
1415 /// <summary>
1516 /// Creates a channel wrapper that takes the provided channel and transforms them on demand when being read.
1617 /// </summary>
1718 /// <param name="source">The channel containing the source data.</param>
1819 /// <param name="transform">The transform function to be applied to the results when being read.</param>
19- public TransformChannel ( Channel < TWrite , TWrite > source , Func < TWrite , TRead > transform )
20+ public TransformChannel ( Channel < TWrite , TRead > source , Func < TRead , TResult > transform )
2021 {
2122 if ( source is null ) throw new ArgumentNullException ( nameof ( source ) ) ;
2223 if ( transform is null ) throw new ArgumentNullException ( nameof ( transform ) ) ;
@@ -26,4 +27,22 @@ public TransformChannel(Channel<TWrite, TWrite> source, Func<TWrite, TRead> tran
2627 Reader = source . Reader . Transform ( transform ) ;
2728 }
2829 }
30+
31+ /// <summary>
32+ /// A channel wrapper that takes the provided channel and transforms them on demand when being read.
33+ /// </summary>
34+ /// <typeparam name="T">Specifies the type of data that may be written to the channel.</typeparam>
35+ /// <typeparam name="TResult">Specifies the type of data that may be read from the channel.</typeparam>
36+ public class TransformChannel < T , TResult > : TransformChannel < T , T , TResult >
37+ {
38+ /// <summary>
39+ /// Creates a channel wrapper that takes the provided channel and transforms them on demand when being read.
40+ /// </summary>
41+ /// <param name="source">The channel containing the source data.</param>
42+ /// <param name="transform">The transform function to be applied to the results when being read.</param>
43+ public TransformChannel ( Channel < T , T > source , Func < T , TResult > transform )
44+ : base ( source , transform )
45+ {
46+ }
47+ }
2948}
0 commit comments