Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DyteJs

Official state management library for DativeJs

import Dative from 'https://cdn.jsdelivr.net/gh/dativeJs/dativejs@main/dist/dative.es.min.js';
 import Dyte from 'https://cdn.jsdelivr.net/npm/[email protected]/dist/dyte.es.min.js';
      
  Dative.use(Dyte);
     
  var store = new Dyte.Store({
    state:{
     count: 0
    },
    mutations:{
     increment(state){
        state.count++
     }
    },
    actions:{
     increase({ commit }){
      commit('increment')
     }
   }
  })
     
  var vm = new Dative({
    el: "#app",
    store: store,
    computed:{
      count(){
        return this.store.state.count
      }
    }
    template: function(){
     return `
        <h1>Testing dyte</h1>
        <p>Count: {{ count }}</p>
        <button on:click="counter">Add #1</button>
           `
    },
    methods:{
      counter: function(){
       this.store.dispatch('increase');
      }
    }
   })
vm.render();

About

Official State management library for DativeJs

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages