Skip to content

Commit 1c19484

Browse files
committed
Unwrap EnvironmentAttributeKey for logging
1 parent a7cf443 commit 1c19484

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
_No unreleased changes_
1111

12+
## [3.0.0-pre15] - 2024-11-21
13+
14+
### Added
15+
- Unwrap EnvironmentAttributeKey for logging by @TimLariviere
16+
1217
## [3.0.0-pre14] - 2024-11-21
1318

1419
### Added
@@ -187,7 +192,8 @@ _No unreleased changes_
187192
### Changed
188193
- Fabulous.XamarinForms & Fabulous.MauiControls have been moved been out of the Fabulous repository. Find them in their own repositories: [https://github.com/fabulous-dev/Fabulous.XamarinForms](https://github.com/fabulous-dev/Fabulous.XamarinForms) / [https://github.com/fabulous-dev/Fabulous.MauiControls](https://github.com/fabulous-dev/Fabulous.MauiControls)
189194

190-
[unreleased]: https://github.com/fabulous-dev/Fabulous/compare/3.0.0-pre14...HEAD
195+
[unreleased]: https://github.com/fabulous-dev/Fabulous/compare/3.0.0-pre15...HEAD
196+
[3.0.0-pre15]: https://github.com/fabulous-dev/Fabulous/releases/tag/3.0.0-pre15
191197
[3.0.0-pre14]: https://github.com/fabulous-dev/Fabulous/releases/tag/3.0.0-pre14
192198
[3.0.0-pre13]: https://github.com/fabulous-dev/Fabulous/releases/tag/3.0.0-pre13
193199
[3.0.0-pre12]: https://github.com/fabulous-dev/Fabulous/releases/tag/3.0.0-pre12

src/Fabulous/Components/Environment.fs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ type EnvironmentExtensions =
2323
) =
2424
ComponentBodyBuilder<'msg, 'marker>(fun envContext treeContext context bindings ->
2525
let envKey = value.Invoke()
26+
let (EnvironmentAttributeKey key) = envKey.Key
2627

2728
// Listen to changes in the environment
2829
context.LinkDisposable(
29-
$"env_{envKey.Key}",
30+
$"env_{key}",
3031
fun () ->
3132
envContext.ValueChanged.Subscribe(fun args ->
3233
if args.Key = envKey.Key then

src/Fabulous/Components/EnvironmentObject.fs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ type EnvironmentObjectExtensions =
3232
) =
3333
ComponentBodyBuilder<'msg, 'marker>(fun envContext treeContext context bindings ->
3434
let envKey = value.Invoke()
35+
let (EnvironmentAttributeKey key) = envKey.Key
3536

3637
// Listen to changes in the environment
3738
context.LinkDisposable(
38-
$"env_{envKey.Key}",
39+
$"env_{key}",
3940
fun () ->
4041
envContext.ValueChanged.Subscribe(fun args ->
4142
if args.Key = envKey.Key then
@@ -46,7 +47,7 @@ type EnvironmentObjectExtensions =
4647
let state = envContext.Get(envKey)
4748

4849
// Listen to changes in the object
49-
context.LinkDisposable($"env_{envKey.Key}_sub", fun () -> state.Changed.Subscribe(fun () -> context.NeedsRender()))
50+
context.LinkDisposable($"env_{key}_sub", fun () -> state.Changed.Subscribe(fun () -> context.NeedsRender()))
5051
|> ignore
5152

5253
(continuation state).Invoke(envContext, treeContext, context, bindings))

0 commit comments

Comments
 (0)