@@ -7,7 +7,7 @@ import { SwissArmyKnife, clearfyCmd } from './helper/swissArmyKnife'
7
7
8
8
const debug = makeDebugger ( 'L:Doraemon' )
9
9
10
- let store = null
10
+ let doraemon = null
11
11
let pockect$ = null
12
12
let SAK = null
13
13
let cmdResolver = [ ]
@@ -17,7 +17,7 @@ const inputValueIsNotEmpty = R.compose(R.not, R.isEmpty, R.prop('inputValue'))
17
17
const isNotSearching = R . compose ( R . not , R . prop ( 'searching' ) )
18
18
19
19
function queryPocket ( ) {
20
- pockect$ . query ( store . inputValue )
20
+ pockect$ . query ( doraemon . inputValue )
21
21
}
22
22
23
23
const initCmdResolver = ( ) => {
@@ -41,7 +41,7 @@ const initCmdResolver = () => {
41
41
action :( ) => {
42
42
SAK . completeInput ( true )
43
43
queryPocket ( )
44
- store . markState ( {
44
+ doraemon . markState ( {
45
45
inputForOtherUse :true ,
46
46
inputValue :Global . localStorage . getItem ( 'debug' ) ,
47
47
} )
@@ -63,7 +63,7 @@ const initCmdResolver = () => {
63
63
match :SAK . stepTwoCmd ( 'themes' ) ,
64
64
action :cmdpath => {
65
65
const theme = R . last ( cmdpath )
66
- store . changeTheme ( theme )
66
+ doraemon . changeTheme ( theme )
67
67
} ,
68
68
} ,
69
69
{
@@ -81,7 +81,7 @@ const initCmdResolver = () => {
81
81
if ( cmd === 'github' ) {
82
82
Global . window . open ( 'https://github.com/visionmedia/debug' , '_blank' )
83
83
} else if ( cmd === 'write' ) {
84
- Global . localStorage . setItem ( 'debug' , store . inputValue )
84
+ Global . localStorage . setItem ( 'debug' , doraemon . inputValue )
85
85
hidePanel ( )
86
86
}
87
87
} ,
@@ -112,7 +112,7 @@ const initCmdResolver = () => {
112
112
}
113
113
114
114
const doCmd = ( ) => {
115
- const cmd = clearfyCmd ( store . activeRaw )
115
+ const cmd = clearfyCmd ( doraemon . activeRaw )
116
116
// debug('clearfyCmd: ', cmd)
117
117
// Do not use forEach, cause forEach will not break
118
118
for ( let i = 0 ; i < cmdResolver . length ; i += 1 ) {
@@ -175,34 +175,34 @@ export function navToSuggestion(suggestion) {
175
175
}
176
176
177
177
export function hidePanel ( ) {
178
- store . hideDoraemon ( )
178
+ // doraemon .hideDoraemon()
179
179
pockect$ . stop ( )
180
180
}
181
181
182
182
export function inputOnChange ( e ) {
183
183
const inputValue = e . target . value
184
- store . markState ( {
184
+ doraemon . markState ( {
185
185
inputValue,
186
186
// searching: true,
187
187
} )
188
188
queryPocket ( )
189
189
}
190
190
191
191
export function init ( selectedStore ) {
192
- store = selectedStore
193
- debug ( 'store ' , store )
192
+ doraemon = selectedStore
193
+ debug ( 'doraemon ' , doraemon )
194
194
195
- pockect$ = new Pockect ( store )
196
- SAK = new SwissArmyKnife ( store )
195
+ pockect$ = new Pockect ( doraemon )
196
+ SAK = new SwissArmyKnife ( doraemon )
197
197
198
198
initCmdResolver ( )
199
199
200
200
pockect$ . cmdSuggesttion ( ) . subscribe ( res => {
201
201
// debug('--> loadSuggestions res: ', res)
202
- store . loadSuggestions ( res )
202
+ doraemon . loadSuggestions ( res )
203
203
} )
204
204
205
205
pockect$ . emptyInput ( ) . subscribe ( ( ) => {
206
- store . clearSuggestions ( )
206
+ doraemon . clearSuggestions ( )
207
207
} )
208
208
}