aboutsummaryrefslogtreecommitdiff
path: root/src/content/reducers/addon.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/reducers/addon.ts')
-rw-r--r--src/content/reducers/addon.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/content/reducers/addon.ts b/src/content/reducers/addon.ts
new file mode 100644
index 0000000..2131228
--- /dev/null
+++ b/src/content/reducers/addon.ts
@@ -0,0 +1,22 @@
+import * as actions from '../actions';
+
+export interface State {
+ enabled: boolean;
+}
+
+const defaultState: State = {
+ enabled: true,
+};
+
+export default function reducer(
+ state: State = defaultState,
+ action: actions.AddonAction,
+): State {
+ switch (action.type) {
+ case actions.ADDON_SET_ENABLED:
+ return { ...state,
+ enabled: action.enabled, };
+ default:
+ return state;
+ }
+}