Socket
Book a DemoInstallSign in
Socket

ampersand-state-mixin-datatype-function

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ampersand-state-mixin-datatype-function

Adds the function datatype to ampersand-state

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

ampersand-state-mixin-datatype-function

Adds the function datatype to ampersand-state

You may want to specify something like the following in your ampersand-states or ampersand-models:

var State = require('ampersand-state');
var MyState = State.extend({
    props: {
        beep: {
            type: 'function',
            required: true
        }
    }
});

usage

Using the example from above

var State = require('ampersand-state');
var funcMixin = require('ampersand-state-mixin-datatype-function');
var StateF = State.extend(funcMixin, {
    props: {
        beep: {
            type: 'function',
            required: true
        }
    }
});

var robot = new StateF({
    beep: function() {
        console.log('bop');
    }
});

robot.beep(); //=> 'bop'

Keywords

ampersand

FAQs

Package last updated on 14 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts