How to use the watch.Verify function in watch

To help you get started, we’ve selected a few watch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Kenshin / simpread / src / focus / controlbar.jsx View on Github external
new Notify().Render( "移动鼠标选择高亮区域,以便生成阅读模式,将会在页面刷新后失效。" );
                    ReactDOM.unmountComponentAtNode( getRoot() );
                    highlight.Start().done( dom => {
                        callback && callback( dom );
                    });
                    break;
                default:
                    if ( type.indexOf( "_" ) > 0 && type.startsWith( "share" ) || 
                         [ "save", "markdown", "png", "epub", "pdf", "kindle", "temp", "html", "dropbox", "pocket", "instapaper", "linnk", "yinxiang","evernote", "onenote", "gdrive" ].includes( type )) {
                        const [ title, desc, content ] = [ $( "head title" ).text().trim(), "", $( ".simpread-focus-highlight" ).html().trim() ];
                        output.Action( type, title, desc, content );
                    }
            };
        }

        ![ "exit", "top" ].includes( type ) ? watch.Verify( ( state, result ) => {
            if ( state ) {
                console.log( "watch.Lock()", result );
                new Notify().Render( "配置文件已更新,刷新当前页面后才能生效。", "刷新", ()=>location.href = location.href );
            } else action( event, type );
        }) : action( event, type );
    }

watch

Utilities for watching file trees.

Apache-2.0
Latest version published 7 years ago

Package Health Score

65 / 100
Full package analysis