2.0.1 • Published 2 years ago

@shish2k/hyperapp-survive-hmr v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

HyperApp Survive HMR

A handy function to save app state before a reload and load state after it

Given a basic app like:

app({
    init: [
        state,
        FetchInitData(),
    ],
    ...
});

We can add HMR support like:

import { SurviveHMR } from "@shish2k/hyperapp-survive-hmr";

app({
    init: [
        state,
        SurviveHMR(module, [
            FetchInitData(),
        ]),
    ],
    ...
});

Notably instead of running a bunch of effects as part of init, we only run SuriveHMR, and we allow it to run extra effects as-needed

2.0.1

2 years ago

2.0.0

2 years ago

1.0.1

3 years ago

1.0.0

3 years ago