0.1.3 • Published 6 years ago

@musora/models v0.1.3

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

js-models - @musora/models

Data models for all Musora back-end services

Build Status Coverage Status

Installation

Yarn

yard add @musora/models

NPM

npm install @musora/models --save

Usage

ContentModel

Accessing Data

import { ContentModel } from '@musora/models';

const content = new ContentModel(post);

const contentTitle = content.getField('title');

Extending Models for Data Binding

import { ContentModel } from '@musora/models';

export class Song extends ContentModel {
    constructor(){
        super();
    
        this.cardTitle = this.getField('title');
        this.cardDescription = this.getData('description');
    }
}
React
<ContentCard 
    title={song.cardTitle}
    description={song.cardDescription}
/>
Vue
<ContentCard 
    :title="song.cardTitle"
    :description="song.cardDescription"
/>