diff options
author | Stefan Malzner <stefan@adlk.io> | 2019-07-30 11:41:54 +0200 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2019-07-30 11:41:54 +0200 |
commit | d7ed456a7b6f73e046ba3a2ef38eb21f82f06ca4 (patch) | |
tree | f24f4f39ae38bdfdd581f451fc3e2e79f5670df5 /src/features/todos/index.js | |
parent | Fix position of todos app (diff) | |
download | ferdium-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.js | 33 |
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 @@ | |||
1 | import { reaction } from 'mobx'; | ||
2 | import TodoStore from './store'; | ||
3 | |||
4 | const debug = require('debug')('Franz:feature:todos'); | ||
5 | |||
6 | export const GA_CATEGORY_TODOS = 'Todos'; | ||
7 | |||
8 | export const DEFAULT_TODOS_WIDTH = 300; | ||
9 | export const TODOS_MIN_WIDTH = 200; | ||
10 | |||
11 | export const todoStore = new TodoStore(); | ||
12 | |||
13 | export 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 | } | ||