https://github.com/riot/hot-reload
Riot hot reload API
https://github.com/riot/hot-reload
hmr riot
Last synced: 2 days ago
JSON representation
Riot hot reload API
- Host: GitHub
- URL: https://github.com/riot/hot-reload
- Owner: riot
- License: mit
- Created: 2016-12-18T17:15:09.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2023-10-06T20:23:40.000Z (over 1 year ago)
- Last Synced: 2024-04-24T20:03:12.868Z (about 1 year ago)
- Topics: hmr, riot
- Language: JavaScript
- Homepage:
- Size: 536 KB
- Stars: 16
- Watchers: 7
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Riot hot reload api
[](https://github.com/riot/hot-reload/)
[![Build Status][ci-image]][ci-url]
[![NPM version][npm-version-image]][npm-url]
[![NPM downloads][npm-downloads-image]][npm-url]
[![MIT License][license-image]][license-url]Api that will extend riot making your tags hot reloadable.
## Important
If you are using Riot.js < 4.0.0 please check the [v3 branch](https://github.com/riot/hot-reload/tree/v3)
## Usage
```js
import reload from '@riotjs/hot-reload'
import Component from './my-component'
// refresh all the DOM nodes called 'my-component' without losing their state
reload(Component)
```[ci-image]:https://img.shields.io/github/actions/workflow/status/riot/hot-reload/test.yml?style=flat-square
[ci-url]:https://github.com/riot/hot-reload/actions
[license-image]: https://img.shields.io/badge/license-MIT-000000.svg?style=flat-square
[license-url]: LICENSE.txt
[npm-version-image]: https://img.shields.io/npm/v/@riotjs/hot-reload.svg?style=flat-square
[npm-downloads-image]: https://img.shields.io/npm/dm/@riotjs/hot-reload.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@riotjs/hot-reload
[codeclimate-image]: https://codeclimate.com/github/riot/hot-reload/badges/issue_count.svg
[codeclimate-url]: https://codeclimate.com/github/riot/hot-reload