aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHayleigh Thompson <me@hayleigh.dev>2023-09-09 18:44:22 +0100
committerHayleigh Thompson <me@hayleigh.dev>2023-09-09 18:44:22 +0100
commitf6a88070b5e793a2af460090a30f0012ef2af502 (patch)
tree2ea70cfa9cd9d2ee0a2822d97e479494fea3b23b
parent248512565a8c81c4be983ff8caf5ebcf168182f7 (diff)
downloadlustre-f6a88070b5e793a2af460090a30f0012ef2af502.tar.gz
lustre-f6a88070b5e793a2af460090a30f0012ef2af502.zip
:recycle: Rename 'action' type variables to 'msg'.
-rw-r--r--lib/src/lustre/effect.gleam12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/src/lustre/effect.gleam b/lib/src/lustre/effect.gleam
index 3dae2aa..1f91e09 100644
--- a/lib/src/lustre/effect.gleam
+++ b/lib/src/lustre/effect.gleam
@@ -8,8 +8,8 @@ import gleam/list
/// It is parameterised by our app's `action` type because some effects need to
/// get information back into your program.
///
-pub opaque type Effect(action) {
- Effect(List(fn(fn(action) -> Nil) -> Nil))
+pub opaque type Effect(msg) {
+ Effect(List(fn(fn(msg) -> Nil) -> Nil))
}
// CONSTRUCTORS ----------------------------------------------------------------
@@ -35,15 +35,15 @@ pub opaque type Effect(action) {
/// }
/// ```
///
-pub fn from(effect: fn(fn(action) -> Nil) -> Nil) -> Effect(action) {
+pub fn from(effect: fn(fn(msg) -> Nil) -> Nil) -> Effect(msg) {
Effect([effect])
}
/// Typically our app's `update` function needs to return a tuple of
-/// `#(model, Effect(action))`. When we don't need to perform any side effects we
+/// `#(model, Effect(msg))`. When we don't need to perform any side effects we
/// can just return `none()`!
///
-pub fn none() -> Effect(action) {
+pub fn none() -> Effect(msg) {
Effect([])
}
@@ -51,7 +51,7 @@ pub fn none() -> Effect(action) {
///
///
-pub fn batch(effects: List(Effect(action))) -> Effect(action) {
+pub fn batch(effects: List(Effect(msg))) -> Effect(msg) {
Effect({
use b, Effect(a) <- list.fold(effects, [])
list.append(b, a)