-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPromiseContinuation.cs
More file actions
31 lines (27 loc) · 913 Bytes
/
Copy pathPromiseContinuation.cs
File metadata and controls
31 lines (27 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
namespace Ramda.NET
{
/// <summary>
/// Provides a continuation context as a result of calling to <see cref="PromiseLikeDynamicDelegate" />Then method
/// </summary>
public class PromiseContinuation
{
private dynamic value;
/// <summary>
/// Initializes a new instance of the <see cref="PromiseContinuation"/> class.
/// </summary>
/// <param name="value">The value.</param>
public PromiseContinuation(dynamic value) {
this.value = value;
}
/// <summary>
/// Gets a continuation callback and invokes it.
/// </summary>
/// <param name="continuation">The continuation.</param>
/// <returns></returns>
public PromiseContinuation Then(Func<dynamic, dynamic> continuation) {
value = continuation(value);
return this;
}
}
}