Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

Add migration and save callbacks to persist methodΒ #213

@bennobuilder

Description

@bennobuilder

πŸ†• Feature Request

❓ Is your feature request related to a problem?

No

πŸ“„ Describe the solution you'd like

const MY_STATE = createState({name: 'jeff', created: new Date()})
MY_STATE.persist('dummyKey', {
    onMigrate: (value) => ({name: value.name, created: new Date(value.created)}),
    onSave: (value) => ({name: value.name, created: value.created.getDate()})
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    @agile-ts/coreRelated to the @agile-ts/core packageenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions