You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
remote: Resolving deltas: 100% (14/14), completed with 12 local objects.
57
-
To https://github.com/ken-okabe/ken-okabe.github.io
58
-
675ec98..04b62da main -> main
34
+
59
35
The diamond problem in Functional Reactive Programming (FRP) refers to issues of glitches and inefficiency that arise when a dependency graph forms a diamond shape. Specifically, it occurs when a timeline `D` depends on two other timelines, `B` and `C`, both of which depend on a common source, `A`.
60
36
61
37
```
@@ -206,6 +182,7 @@ How is this dynamic switching of dependencies achieved? The answer lies in the h
206
182
The dynamic switching of dependencies brought about by `.bind()` is a manifestation of a deeper, more powerful concept in the library's design. To understand it, let's first organize the different levels of "mutability" in `map` and `bind`.
207
183
208
184
-**Level 1 Mutability (The world of `map`/`link`)**: In a static dependency, the `Timeline` object itself is an immutable entity. The only thing that is "mutable" is the internal value **`_last`**, which is updated as the `Now` viewpoint moves. This can be called the minimal unit of **illusion**, the "current value" in the block universe.
185
+
209
186
-**Level 2 Mutability (The world of `bind`)**: When `.bind()` is introduced, this concept of mutability is **extended**. It's no longer just the `_last` value that gets replaced. The `innerTimeline` object returned by `.bind()` is swapped out entirely according to the source's value. This means that the **`Timeline` itself, which defines the "truth" of a given moment, becomes a temporary, replaceable entity**.
210
187
211
188
This "structural" level of mutability is the essence of the `Illusion` concept.
@@ -271,7 +248,13 @@ console.log("Switched user posts:", currentUserPostsTimeline.at(Now));
271
248
// > Switched user posts: ["post3", "post4"]
272
249
```
273
250
274
-
This code example brilliantly demonstrates two aspects of `bind`. First, the **theoretical aspect**: it describes the complex requirement of dynamically switching the UI state in a highly declarative way. Second, the **implementation aspect**: behind the scenes, `DependencyCore` reliably disposes of the old `innerTimeline` through the `Illusion` mechanism, so the developer does not need to be conscious of resource management. Thus, `bind` shows its true value only when a powerful theory and a robust implementation that supports it are combined.
251
+
This code example brilliantly demonstrates two aspects of `bind`.
252
+
253
+
First, the **theoretical aspect**: it describes the complex requirement of dynamically switching the UI state in a highly declarative way.
254
+
255
+
Second, the **implementation aspect**: behind the scenes, `DependencyCore` reliably disposes of the old `innerTimeline` through the `Illusion` mechanism, so the developer does not need to be conscious of resource management.
256
+
257
+
Thus, `bind` shows its true value only when a powerful theory and a robust implementation that supports it are combined.
remote: Resolving deltas: 100% (14/14), completed with 12 local objects.
59
-
To https://github.com/ken-okabe/ken-okabe.github.io
60
-
675ec98..04b62da main -> main
36
+
61
37
The diamond problem in Functional Reactive Programming (FRP) refers to issues of glitches and inefficiency that arise when a dependency graph forms a diamond shape. Specifically, it occurs when a timeline `D` depends on two other timelines, `B` and `C`, both of which depend on a common source, `A`.
62
38
63
39
```
@@ -208,6 +184,7 @@ How is this dynamic switching of dependencies achieved? The answer lies in the h
208
184
The dynamic switching of dependencies brought about by `.bind()` is a manifestation of a deeper, more powerful concept in the library's design. To understand it, let's first organize the different levels of "mutability" in `map` and `bind`.
209
185
210
186
-**Level 1 Mutability (The world of `map`/`link`)**: In a static dependency, the `Timeline` object itself is an immutable entity. The only thing that is "mutable" is the internal value **`_last`**, which is updated as the `Now` viewpoint moves. This can be called the minimal unit of **illusion**, the "current value" in the block universe.
187
+
211
188
-**Level 2 Mutability (The world of `bind`)**: When `.bind()` is introduced, this concept of mutability is **extended**. It's no longer just the `_last` value that gets replaced. The `innerTimeline` object returned by `.bind()` is swapped out entirely according to the source's value. This means that the **`Timeline` itself, which defines the "truth" of a given moment, becomes a temporary, replaceable entity**.
212
189
213
190
This "structural" level of mutability is the essence of the `Illusion` concept.
@@ -273,7 +250,13 @@ console.log("Switched user posts:", currentUserPostsTimeline.at(Now));
273
250
// > Switched user posts: ["post3", "post4"]
274
251
```
275
252
276
-
This code example brilliantly demonstrates two aspects of `bind`. First, the **theoretical aspect**: it describes the complex requirement of dynamically switching the UI state in a highly declarative way. Second, the **implementation aspect**: behind the scenes, `DependencyCore` reliably disposes of the old `innerTimeline` through the `Illusion` mechanism, so the developer does not need to be conscious of resource management. Thus, `bind` shows its true value only when a powerful theory and a robust implementation that supports it are combined.
253
+
This code example brilliantly demonstrates two aspects of `bind`.
254
+
255
+
First, the **theoretical aspect**: it describes the complex requirement of dynamically switching the UI state in a highly declarative way.
256
+
257
+
Second, the **implementation aspect**: behind the scenes, `DependencyCore` reliably disposes of the old `innerTimeline` through the `Illusion` mechanism, so the developer does not need to be conscious of resource management.
258
+
259
+
Thus, `bind` shows its true value only when a powerful theory and a robust implementation that supports it are combined.
0 commit comments