How to use kinto - 4 common examples

To help you get started, we’ve selected a few kinto examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github joezimjs / Vue-Tutorial-Search-Example / src / stores / tutorials.js View on Github external
import Kinto from 'kinto'

let db = new Kinto({
  remote: 'https://tut-search.herokuapp.com/v1/',
  bucket: 'tut-search'
})
let tutorialAPI = db.collection('tutorials')

if (process.env.NODE_ENV === 'development') {
  window.tutorialAPI = tutorialAPI
  console.debug('Tutorial API available at `tutorialAPI`')
}

export default {
  namespaced: true,
  state: {
    data: []
  },
  getters: {
github Kinto / kinto-admin / scripts / reducers / form.js View on Github external
export default function form(state = INITIAL_STATE, action) {
  switch (action.type) {
  case FORM_RECORD_LOADED:
    return {
      ...state,
      record: action.record,
      formData: cleanRecord(action.record, FORMDATA_IGNORE_FIELDS),
    };
  case FORM_RECORD_UNLOADED:
    return {...state, record: null, formData: null};
  case FORM_DATA_RECEIVED:
    return {...state, formData: action.formData};
  default:
    return state;
  }
}
github Kinto / kinto-admin / scripts / actions / form.js View on Github external
return (dispatch, getState) => {
    const {record, formData} = getState().form;
    const cleanFormData = cleanRecord(formData, FORMDATA_IGNORE_FIELDS);
    dispatch(update({...record, ...cleanFormData}));
  };
}
github Kinto / kinto-admin / scripts / reducers / conflicts.js View on Github external
return action.conflicts.reduce((acc, conflict) =>  {
      acc[conflict.local.id] = {
        ...conflict,
        local: cleanRecord(conflict.local, ["_status"])
      };
      return acc;
    }, {});
  }

kinto

An Offline-First JavaScript client for Kinto.

Apache-2.0
Latest version published 1 year ago

Package Health Score

65 / 100
Full package analysis