@@ -7,7 +7,7 @@ import { SwissArmyKnife, clearfyCmd } from './helper/swissArmyKnife'
77
88const debug = makeDebugger ( 'L:Doraemon' )
99
10- let store = null
10+ let doraemon = null
1111let pockect$ = null
1212let SAK = null
1313let cmdResolver = [ ]
@@ -17,7 +17,7 @@ const inputValueIsNotEmpty = R.compose(R.not, R.isEmpty, R.prop('inputValue'))
1717const isNotSearching = R . compose ( R . not , R . prop ( 'searching' ) )
1818
1919function queryPocket ( ) {
20- pockect$ . query ( store . inputValue )
20+ pockect$ . query ( doraemon . inputValue )
2121}
2222
2323const initCmdResolver = ( ) => {
@@ -41,7 +41,7 @@ const initCmdResolver = () => {
4141 action : ( ) => {
4242 SAK . completeInput ( true )
4343 queryPocket ( )
44- store . markState ( {
44+ doraemon . markState ( {
4545 inputForOtherUse : true ,
4646 inputValue : Global . localStorage . getItem ( 'debug' ) ,
4747 } )
@@ -63,7 +63,7 @@ const initCmdResolver = () => {
6363 match : SAK . stepTwoCmd ( 'themes' ) ,
6464 action : cmdpath => {
6565 const theme = R . last ( cmdpath )
66- store . changeTheme ( theme )
66+ doraemon . changeTheme ( theme )
6767 } ,
6868 } ,
6969 {
@@ -81,7 +81,7 @@ const initCmdResolver = () => {
8181 if ( cmd === 'github' ) {
8282 Global . window . open ( 'https://github.com/visionmedia/debug' , '_blank' )
8383 } else if ( cmd === 'write' ) {
84- Global . localStorage . setItem ( 'debug' , store . inputValue )
84+ Global . localStorage . setItem ( 'debug' , doraemon . inputValue )
8585 hidePanel ( )
8686 }
8787 } ,
@@ -112,7 +112,7 @@ const initCmdResolver = () => {
112112}
113113
114114const doCmd = ( ) => {
115- const cmd = clearfyCmd ( store . activeRaw )
115+ const cmd = clearfyCmd ( doraemon . activeRaw )
116116 // debug('clearfyCmd: ', cmd)
117117 // Do not use forEach, cause forEach will not break
118118 for ( let i = 0 ; i < cmdResolver . length ; i += 1 ) {
@@ -175,34 +175,34 @@ export function navToSuggestion(suggestion) {
175175}
176176
177177export function hidePanel ( ) {
178- store . hideDoraemon ( )
178+ // doraemon .hideDoraemon()
179179 pockect$ . stop ( )
180180}
181181
182182export function inputOnChange ( e ) {
183183 const inputValue = e . target . value
184- store . markState ( {
184+ doraemon . markState ( {
185185 inputValue,
186186 // searching: true,
187187 } )
188188 queryPocket ( )
189189}
190190
191191export function init ( selectedStore ) {
192- store = selectedStore
193- debug ( 'store ' , store )
192+ doraemon = selectedStore
193+ debug ( 'doraemon ' , doraemon )
194194
195- pockect$ = new Pockect ( store )
196- SAK = new SwissArmyKnife ( store )
195+ pockect$ = new Pockect ( doraemon )
196+ SAK = new SwissArmyKnife ( doraemon )
197197
198198 initCmdResolver ( )
199199
200200 pockect$ . cmdSuggesttion ( ) . subscribe ( res => {
201201 // debug('--> loadSuggestions res: ', res)
202- store . loadSuggestions ( res )
202+ doraemon . loadSuggestions ( res )
203203 } )
204204
205205 pockect$ . emptyInput ( ) . subscribe ( ( ) => {
206- store . clearSuggestions ( )
206+ doraemon . clearSuggestions ( )
207207 } )
208208}
0 commit comments