Natural Pacifist Manatees

    mutent-migration
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.0 • Public • Published

    mutent-migration

    import { Store } from 'mutent'
    import { mutentMigration } from 'mutent-migration'
    
    const store = new Store({
      adapter: new MyAdapter(),
      // Add the migration plugin to the store declaration
      plugins: [
        mutentMigration({
          // Required version
          version: 1,
          // Version field name
          key: 'v',
          // Migration strategies
          strategies: {
            // Migration strategy from version 0 to version 1
            1: data => {
              return {
                v: 1,
                newFieldname: data.oldFieldName
              }
            }
          }
        })
      ]
    })
    
    // Use the migrated store

    Install

    npm i mutent-migration

    DownloadsWeekly Downloads

    2

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    7.78 kB

    Total Files

    6

    Last publish

    Collaborators

    • greguz