web-es6

0.1.0 • Public • Published

widget

dosomething.js

import widget from 'web-es6/widget'
 
export default widget({
  event:{
    init:function(){
      this.doSomething()
    }
  },
  doSomething:function(){
    this.el.innerHTML ='do something';
  }
})

run.js

import ds from `dosomething.js`;
 
new ds({el:body});

ready

import ready from 'web-es6/ready'
 
ready(()=>{
  console.log("it's document ready.");
}, {
  'hi':()=>{
    console.log("hash is #hi");
  }
});

ajax

import ajax from 'web-es6/ajax';
 
let getUser =ajax('/user').get({page:1, max:10});
getUser().then((data)=>{
  //doAnythingYouWant();
});

Package Sidebar

Install

npm i web-es6

Weekly Downloads

8

Version

0.1.0

License

ISC

Unpacked Size

31.8 kB

Total Files

20

Last publish

Collaborators

  • vea