npm.io
0.0.1 • Published 5 years ago

vue-tiny-model

Licence
MIT
Version
0.0.1
Deps
1
Size
60 kB
Vulns
0
Weekly
0
Stars
2

Tiny Model layer for vue3

Usage

import { bind, defineModel } from 'vue-tiny-model';

interface IQuote {
  bid: number;
  ask: number;
  mid: number;
}

const Quote = defineModel<IQuote>({
  bid: null,
  ask: null,
  mid: bind<IQuote>(function () {
    return (this.ask + this.bid) / 2;
  }),
});

const raw = response.data;

const quote = new Quote(raw);

Development

Install

Install the dependencies with yarn:

yarn
Build
yarn build --watch
Test
yarn test --watch
License

MIT

Keywords