[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Wed, 30 Nov 2022 13:36:42 -0500 (EST) |
branch: old/qt-info
commit 2f576aae34e16fe94424b3478b31b75e4c1b99a1
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Mon Apr 15 19:10:33 2019 +0100
Remove a parameter of the Store object.
* js/info.js (Store): Remove 'reducer' argument: call updater
unconditionally.
---
ChangeLog | 7 +++++++
js/info.js | 11 +++++------
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b0f4e108ab..a38cd36fe6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2019-04-13 Gavin Smith <gavinsmith0123@gmail.com>
+
+ Remove a parameter of the Store object.
+
+ * js/info.js (Store): Remove 'reducer' argument: call updater
+ unconditionally.
+
2019-04-13 Gavin Smith <gavinsmith0123@gmail.com>
Fix direction after index search.
diff --git a/js/info.js b/js/info.js
index 2f8e3236f8..033db12409 100644
--- a/js/info.js
+++ b/js/info.js
@@ -72,16 +72,15 @@ var user_config = window["INFO_CONFIG"];
@arg {function (Object, Action): Object} reducer
@arg {Object} state */
function
- Store (reducer, state)
+ Store (state)
{
this.listeners = [];
- this.reducer = reducer;
this.state = state;
}
/** @arg {Action} action */
Store.prototype.dispatch = function dispatch (action) {
- var new_state = this.reducer (this.state, action);
+ var new_state = updater (this.state, action);
if (new_state !== this.state)
{
this.state = new_state;
@@ -195,7 +194,7 @@ var user_config = window["INFO_CONFIG"];
};
/** Update STATE based on the type of ACTION. This update is purely
- fonctional since STATE is not modified in place and a new state object
+ functional since STATE is not modified in place and a new state object
is returned instead.
@arg {Object} state
@arg {Action} action
@@ -399,7 +398,7 @@ var user_config = window["INFO_CONFIG"];
return res;
}
default:
- console.error ("no reducer for action type:", action.type);
+ console.error ("unhandled action type:", action.type);
return state;
}
}
@@ -2049,7 +2048,7 @@ function init() {
text_input: null
};
- store = new Store (updater, initial_state);
+ store = new Store (initial_state);
var top_page = init_top_page ();
var sidebar = init_sidebar ();
window.addEventListener ("DOMContentLoaded", function () {
- [no subject], (continued)
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject],
Gavin D. Smith <=
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30