Skip to content
MokoJsPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

moko-defaults

Default value plugin for moko.

Example

var defaults = require('moko-defaults');

User.use(defaults);

User.attr('favoriteColor', { default: 'purple' });

User.attr('age', { default: function(user) {
  return Math.floor(15 + Math.random() * 10 ) // age between 15-25
}});

User.attr('parentAge', { default: function*(user) {
  return (yield User.find(user.parent)).age;
}});

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages