Narcissistic Project Managers

    @harlem/plugin-snapshot
    TypeScript icon, indicating that this package has built-in type declarations

    1.3.2 • Public • Published

    Harlem

    Harlem Snapshot Plugin

    npm

    This is the official Harlem plugin for taking state snapshots and applying them when convenient.

    Getting started

    Before installing the snapshot plugin make sure you have installed @harlem/core.

    1. Install @harlem/plugin-snapshot:
    npm install @harlem/plugin-snapshot
    

    Or if you're using Yarn:

    yarn add @harlem/plugin-snapshot
    
    1. Create an instance of the plugin and register it with Harlem:
    import App from './app.vue';
    
    import harlem from '@harlem/core';
    import createSnapshotPlugin from '@harlem/plugin-snapshot';
    
    createApp(App)
        .use(harlem, {
            plugins: [
                createSnapshotPlugin()
            ]
        })
        .mount('#app');
    1. Call the snapshot method with the name of the store you wish to snapshot:
    import {
        snapshot
    } from '@harlem/plugin-snapshot';
    
    export default function() {
        const snap = snapshot('my-store');
    
        // ...
    }
    1. Apply the snapshot:
    const snap = snapshot('my-store');
    
    snap.apply(); // Apply the snapshot over the top of current state
    snap.apply(true) // Replace state with the current snapshot

    Install

    npm i @harlem/plugin-snapshot

    Homepage

    harlemjs.com

    DownloadsWeekly Downloads

    4

    Version

    1.3.2

    License

    MIT

    Unpacked Size

    37.5 kB

    Total Files

    28

    Last publish

    Collaborators

    • andrewcourtice