UNPKG

@json-express/core

Version:

A simple json server which serves all json files

14 lines (8 loc) 287 B
import { addItem } from '../services/storage-service.js' const store = {} export const addCollection = (collection, initialData = []) => { if (store[collection]) return store[collection] = [] initialData.forEach(data => addItem(collection, data)) } export default store