import m from "mithril" const Section = { current: {}, list: [], loading: false, fetch: function(id) { Section.loading = true m.request({ url: "http://api.questionnaire.dev/v1/sections/" + id, method: "GET" }) .then(function(res) { Section.current = res Section.loading = false }) } } export default Section