@nuxtjs/feed
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="1.1.0"></a> | ||
# [1.1.0](https://github.com/nuxt-community/feed-module/compare/v1.0.0...v1.1.0) (2019-01-12) | ||
### Features | ||
* factory object ([#30](https://github.com/nuxt-community/feed-module/issues/30)) ([0a62219](https://github.com/nuxt-community/feed-module/commit/0a62219)) | ||
<a name="1.0.0"></a> | ||
@@ -7,0 +17,0 @@ # [1.0.0](https://github.com/nuxt-community/feed-module/compare/v0.2.0...v1.0.0) (2019-01-12) |
@@ -17,2 +17,3 @@ import path from 'path' | ||
export default async function feed () { | ||
// Factory function | ||
if (typeof this.options.feed === 'function') { | ||
@@ -22,3 +23,11 @@ this.options.feed = await this.options.feed() | ||
// Factory object | ||
if (!Array.isArray(this.options.feed)) { | ||
if (this.options.feed.factory) { | ||
this.options.feed = await this.options.feed.factory(this.options.feed.data) | ||
} | ||
} | ||
// Single feed | ||
if (!Array.isArray(this.options.feed)) { | ||
this.options.feed = [this.options.feed] | ||
@@ -25,0 +34,0 @@ } |
{ | ||
"name": "@nuxtjs/feed", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -154,3 +154,14 @@ # Feed module - Everyone deserves RSS, Atom and Json | ||
In case you want to pass in data into the factory function, you can use a *factory object*. | ||
```js | ||
{ | ||
feed: { | ||
data: ['Your data here'] | ||
factory: (dataFromFeedDotData) => {/* your factory function */} | ||
} | ||
} | ||
``` | ||
## Development | ||
@@ -157,0 +168,0 @@ |
12800
78
177