Skip to content

Commit a5fb4da

Browse files
committed
suppress eager updates on Props creation
presumably, multiple properties will be set
1 parent 958f07e commit a5fb4da

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Source/DynamicProperties/Props.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Shabby.DynamicProperties;
88

9-
public sealed class Props(int priority) : IDisposable
9+
public sealed class Props : IDisposable
1010
{
1111
/// Ordered by lowest to highest priority. Equal priority is disambiguated by unique IDs.
1212
/// Note that this is compatible with default object reference equality.
@@ -21,7 +21,7 @@ public sealed class Props(int priority) : IDisposable
2121

2222
public readonly uint UniqueId = _nextId();
2323

24-
public readonly int Priority = priority;
24+
public readonly int Priority;
2525

2626
private readonly Dictionary<int, Prop> props = [];
2727

@@ -38,6 +38,12 @@ public sealed class Props(int priority) : IDisposable
3838
internal bool NeedsValueUpdate = false;
3939
internal bool NeedsEntriesUpdate = false;
4040

41+
public Props(int priority)
42+
{
43+
Priority = priority;
44+
SuppressEagerUpdatesThisFrame();
45+
}
46+
4147
public void SuppressEagerUpdatesThisFrame()
4248
{
4349
SuppressEagerUpdate = true;

0 commit comments

Comments
 (0)