@m59/reload-client
Client-side script to respond to signals from @m59/reload-server. Can reload the page and refresh css and images.
Last updated 4 years ago by m59 .
CC0-1.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @m59/reload-client 
SYNC missed versions from official npm registry.

Reload Client

Client-side script for triggering page and resource reload over WebSockets.

npm install @m59/reload-client
import Client from '@m59/reload-client'
Client(reloadServerUrl)

JS API

Client(reloadServerUrl, options)

Makes a websocket connection to the given url to listen for reload messages.

  • options: object
    • quiet: boolean, false disable logging to console
  • returns: object
    • socket: the WebSocket
    • ...helpers

WebSocket API

  • string JSON
    • type: string type of reload
      • reload
      • refreshCSS
      • refreshImages
    • path: string path to a changed file (for logging)

Helpers

refreshCSS()

import refreshCSS from '@m59/reload-client/refresh-css'
refreshCSS()

refreshImages()

import refreshImages from '@m59/reload-client/refresh-images'
refreshImages()

Current Tags

  • 1.0.3                                ...           latest (4 years ago)

4 Versions

  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (2)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |