aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/todos/index.js
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2019-07-30 11:41:54 +0200
committerLibravatar Stefan Malzner <stefan@adlk.io>2019-07-30 11:41:54 +0200
commitd7ed456a7b6f73e046ba3a2ef38eb21f82f06ca4 (patch)
treef24f4f39ae38bdfdd581f451fc3e2e79f5670df5 /src/features/todos/index.js
parentFix position of todos app (diff)
downloadferdium-app-d7ed456a7b6f73e046ba3a2ef38eb21f82f06ca4.tar.gz
ferdium-app-d7ed456a7b6f73e046ba3a2ef38eb21f82f06ca4.tar.zst
ferdium-app-d7ed456a7b6f73e046ba3a2ef38eb21f82f06ca4.zip
Make todo layer resizable
Diffstat (limited to 'src/features/todos/index.js')
-rw-r--r--src/features/todos/index.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/features/todos/index.js b/src/features/todos/index.js
new file mode 100644
index 000000000..0dfd35c78
--- /dev/null
+++ b/src/features/todos/index.js
@@ -0,0 +1,33 @@
1import { reaction } from 'mobx';
2import TodoStore from './store';
3
4const debug = require('debug')('Franz:feature:todos');
5
6export const GA_CATEGORY_TODOS = 'Todos';
7
8export const DEFAULT_TODOS_WIDTH = 300;
9export const TODOS_MIN_WIDTH = 200;
10
11export const todoStore = new TodoStore();
12
13export default function initTodos(stores, actions) {
14 stores.todos = todoStore;
15 const { features } = stores;
16
17 // Toggle todos feature
18 reaction(
19 () => features.features.isTodosEnabled,
20 (isEnabled) => {
21 if (isEnabled) {
22 debug('Initializing `todos` feature');
23 todoStore.start(stores, actions);
24 } else if (todoStore.isFeatureActive) {
25 debug('Disabling `todos` feature');
26 todoStore.stop();
27 }
28 },
29 {
30 fireImmediately: true,
31 },
32 );
33}