How to use the skatejs.prop.array function in skatejs

To help you get started, we’ve selected a few skatejs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zzarcon / skatepark.js / packages / tags / src / index.jsx View on Github external
import {
  Component,
  h,
  prop
} from 'skatejs';
import styles from './styles';
import {define} from 'skateparkjs-core';

const deleteCode = 8;

class SKTags extends Component {
  static props = {
    delimiter: prop.string({attribute: true, default: ' '}),
    tags: prop.array({attribute: true}),
    deletion: {
      attribute: true,
      default: false
    },
    //TODO: Implement editable tags
    editable: {
      attribute: true,
      default: true
    }
  }

  renderCallback() {
    const tags = this.tags;
    const allowDeletion = this.deletion ? 'deletion' : '';
    const tagElements = tags.map(t => {
      const tagContent = allowDeletion ? <span class="deletion">{t}</span> : t;
github micahscopes / all-around-keyboard / src / main.js View on Github external
static get props () {
    return {
      notesInOctave: prop.number({ attribute: true, default: 12 }),
      raisedNotes: prop.array({ attribute: true, default: [1,3,6,8,10] }),
      octaves: prop.number({ attribute: true, default: 2 }),
      sweep: prop.number({ attribute: true, default: Math.PI/2,
        deserialize (val) {
          return val*Math.PI/180;
        },
        serialize (val) {
          return val*180/Math.PI;
        }
      }),
      depth: prop.number({ attribute: true, default: 100 }),
      width: prop.number({ attribute: true, default: 500 }),
      overlapping: prop.number({ attribute: true, default: 0.5 }),
      pie: prop.boolean({attribute: true, default: false}),
      synth: prop.boolean({attribute: true, default: false}),
      transitionTime: prop.number({attribute: true, default: 750}),
      baseTone: prop.number({attribute: true, default: 32.70375}),