Keet.js v4.2.1

Keet.js v4.2.1

  • Docs
  • API
  • Help

›V4 API

V4 API

  • keet
  • CreateModel

CreateModel

keet/CreateModel

Example

import { CreateModel } from 'keet'

class myModel extends CreateModel {
  contructor() {
    super()
    // props
  }
  // new extended method
  myMethod(...args){
    this.list = args
  }
}

const MyModel = new myModel()
  • keet/CreateModel
    • .subscribe(fn)
    • .add(obj)
    • .update(updateObj)
    • .filter(prop, value)
    • .destroy(destroyObj)

keet/CreateModel.subscribe(fn)

Subscribe to the model changes, the function callback first argument is the model.list and the second argument is model.listFilter

Kind: instance method of keet/CreateModel

ParamTypeDescription
fnfunctionthe function callback for the subscribe

keet/CreateModel.add(obj)

Add new object to the model list

Kind: instance method of keet/CreateModel

ParamTypeDescription
objObjectnew object to add into the model list

keet/CreateModel.update(updateObj)

Update existing object in the model list

Kind: instance method of keet/CreateModel

ParamTypeDescription
updateObjObjectthe updated properties

keet/CreateModel.filter(prop, value)

Filter the model data by selected properties, constructor instantiation should be apply with boolean true as argument to enable filtering

Kind: instance method of keet/CreateModel

ParamTypeDescription
propstringproperty of the object
valueObject string number Booleanproperty value

keet/CreateModel.destroy(destroyObj)

Removed existing object in the model list

Kind: instance method of keet/CreateModel

ParamTypeDescription
destroyObjObjectthe object ref to remove from the model
← Previous
  • keet/CreateModel
    • keet/CreateModel.subscribe(fn)
    • keet/CreateModel.add(obj)
    • keet/CreateModel.update(updateObj)
    • keet/CreateModel.filter(prop, value)
    • keet/CreateModel.destroy(destroyObj)
Keet.js v4.2.1
Extra
TodoMVCPerformance Benchmark
Community
Gitter Chat
on Github
Star  Fork  Issue

Generated with Docusaurus

Docusaurus
Copyright © 2018 Shahrul Nizam Selamat