canjs / can-define-backup

Backup and restore a DefineMap state
https://canjs.com/doc/can-define-backup.html
MIT License
3 stars 3 forks source link

Proposal: align the interface with can-define-validate-validatejs.js #8

Closed phillipskevin closed 6 years ago

phillipskevin commented 6 years ago

@frank-dspeed commented on Tue Feb 13 2018

In

you can use

var defineValidate = require('can-define-validate-validatejs');
var User = DefineMap.extend({
    name: {
        validate: {
            presence: true
        }
    }
});
// Attach methods to any instance created of `User`
defineValidate(User);

my proposal is to do the same for can-map-backup or can-define-backup which is even a better name

var defineBackup = require('can-define-backup'); // or can-map-backup
var User = DefineMap.extend({
    name: {
        validate: {
            presence: true
        }
    }
});
// Attach methods to any instance created of `User`
defineBackup(User);

@justinbmeyer commented on Tue Feb 13 2018

This would be great

frank-dspeed commented 6 years ago

@christopherjbaker please review #9