@agog/apix
Automatically generate your VUEX store using your REST endpoints
Last updated 8 months ago by fkisiara .
MIT · Original npm · Tarball · package.json
$ cnpm install @agog/apix 
SYNC missed versions from official npm registry.

API-X

Automatically generate your VUEX store using your REST endpoints

Getting Started

Apix runs best on a web application powered by Vue js and Vuex

Internally, apix uses axios to send HTTP requests.

Installing

Using npm

$ npm i @agog/apix

Usage

You can then import and use the apix store generator in your files using the example below

import Vue from 'vue';
import Vuex from 'vuex';
import Apix from '@agog/apix';

Vue.use(Vuex);

let apix = new Apix({
    prefix: '/api/v1',
    headers: {},
    resources: [
        { name: 'marvelHeroes', url: 'marvel-heroes' }
    ],
});

export const store = new Vuex.Store({

    state: {
        ...apix.getState(),
    },

    getters: {
        ...apix.getGetters(),
    },

    mutations: {
        ...apix.getMutations(),
    },

    actions: {
        ...apix.getActions(),
    },
});

Configurations

The apix object constructor accepts an object as a parameter that must contain the resources array of objects, an optional prefix for versioning and optional headers that will be passed to axios internally

Running the tests

In order to run the tests run the following command in the root of the application

npm test

Built With

  • NodeJs - The framework used
  • npm - Dependency management

Authors

Kisiara Francis - Github - Website - LinkedIn

Current Tags

  • 0.0.5-beta.2                                ...           latest (8 months ago)

7 Versions

  • 0.0.5-beta.2                                ...           8 months ago
  • 0.0.5-beta.1                                ...           8 months ago
  • 0.0.5-beta.0                                ...           8 months ago
  • 0.0.4                                ...           a year ago
  • 0.0.3                                ...           a year ago
  • 0.0.2                                ...           a year ago
  • 0.0.1                                ...           a year ago
Downloads
Today 0
This Week 7
This Month 21
Last Day 7
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |