mithril-mobs 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/package.json +1 -1
- package/src/mobs/index.js +18 -0
package/README.md
CHANGED
package/package.json
CHANGED
package/src/mobs/index.js
CHANGED
@@ -235,3 +235,21 @@ const Component = {
|
|
235
235
|
};
|
236
236
|
|
237
237
|
export const createComponent = (def) => Component.create(def);
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
/**
|
243
|
+
* Repeat Helper
|
244
|
+
*/
|
245
|
+
export const repeat = (times, increment = 1) => {
|
246
|
+
return {
|
247
|
+
map(cb) {
|
248
|
+
const items = []
|
249
|
+
for(let i = 0; i < times; i+=increment) {
|
250
|
+
items.push(cb(i))
|
251
|
+
}
|
252
|
+
return items
|
253
|
+
}
|
254
|
+
}
|
255
|
+
}
|