Closed akileez closed 9 years ago
both functions read files then put data to a cache. it would be nice if they could read from a cache as well. this would only be a benefit while running under watch(chokidar). In the case of frontMatter, it could use the same cache (or a clone) of loadTemplates preventing a double read of the same files at startup.
will revisit at another time.
slept on it..
set up both functions to use separate caches like dest function where they compare a local cache to object being passed in. add methods to deal with a object/file change (chokidar)
frontMatter cache implemented: https://github.com/akileez/rendr/commit/e1b197d34d87141531e64778242a910e54c55220
buildStackLayout cache implemented: https://github.com/akileez/rendr/commit/b6ba9deab321dcbd08be85ddfc1b0391a2238b1b
at present, both functions are each using separate read functions to matter(gray-matter). This functionality should be consolidated.