vuex-asr
Version:
* Version: 0.7.52 * License M.I.T. * [Online Documentation](https://vuex-asr.github.io/vuex-asr/) * author: Joris Wenting * email: vuex.asr@gmail.com * [linkedIn](https://www.linkedin.com/in/joriswenting/). * [contribute](https://vuex-asr.github.io/vuex-a
1 lines • 2.76 kB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{213:function(e,t,o){"use strict";o.r(t);var a=o(0),n=Object(a.a)({},(function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[o("h1",{attrs:{id:"about-generalisation"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#about-generalisation","aria-hidden":"true"}},[e._v("#")]),e._v(" About generalisation")]),e._v(" "),o("p",[e._v("I think one of the most important things in configuration management is to generalise a subject or aspect to a manageable proportion. This means that:")]),e._v(" "),o("p",[e._v("If you have specific aspects, be as explicit about your terms as you think needed.")]),e._v(" "),o("p",[e._v("Whenever you have reusability in mind try and find as generic possible terms.")]),e._v(" "),o("h2",{attrs:{id:"in-more-complex-situations"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#in-more-complex-situations","aria-hidden":"true"}},[e._v("#")]),e._v(" In more complex situations")]),e._v(" "),o("p",[e._v("Even in more complex situations, it can relieve you from a lot of naming convention hassle, since you can use generic names for your variables and models in your templates and be specific in your store.")]),e._v(" "),o("picture",{attrs:{of:"",store:"",with:"",specific:"",terms:"",and:"",templates:"",with:"",generalist:"",terms:""}},[o("p",[e._v("Be as explicit about your terms in the store as you think needed.")]),e._v(" "),o("p",[e._v("Use as generic possible terms in your templates.")]),e._v(" "),o("p",[e._v("Let's say we have an array of photos in the store's submodule "),o("code",[e._v("module-photos.js")])]),e._v(" "),o("p",[e._v("stored in "),o("code",[e._v("recentPhotos")])]),e._v(" "),o("pre",[o("code",[e._v('const ModulePhotos = {\n namespaced: true,\n\n state: {\n photos: [],\n recentPhotos: [\n {\n title: "Some picture of a picture",\n url:\n "https://images.unsplash.com/photo-1495808089756-688a7abff51d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=3889&q=80"\n },\n {\n title: "Another picture of a picture",\n url:\n "https://images.unsplash.com/photo-1460339594641-eb86e8402669?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=3900&q=80"\n }\n ]\n }\n};\n\nexport { ModulePhotos };\n')])]),e._v(" "),o("p",[e._v("And we have a template that can display photos, wether they are recent or not.")]),e._v(" "),o("p",[e._v("So now we use our aliassing tool to connect them:")]),e._v(" "),o("p",[o("router-link",{attrs:{to:"/rename/thrash-94fe9415-233a-41a6-a9b2-2d72fde36531.html"}},[e._v("thrash")])],1)])])}),[],!1,null,null,null);t.default=n.exports}}]);