I would like to simulate a delay every time there is new stuff being put into the mongodb and loaded into my template.
The idee is that there is a stream of content being feed to de mongodb which is not constant. So with the “delay” I would like to make it look like it’s constant.
Here’s my code:
Template.body.helpers({
image_stream() {
return full_URI.find({$or: [{"text" : {$regex: /.jpg$/} }, {"text" : {$regex: /.jpeg$/}}, {"text" : {$regex: /.png$/}}, {"text" : {$regex: /.gif$/}}]}, { sort: { createdAt: -1}, limit: 1 });
}
});
<body>
<div id="image_history">
{{#each image_history}}
{{> image}}
{{/each}}
</div>
</body>
<template name="image">
<div id="{{_id}}" class="image {{extension}}" link="{{text}}">
<img src="{{text}}">
<div id="tab">EYE Observed Images</div>
<div class="information">
<span class="date">{{formatDate createdAt}}</span>
<span class="connection">{{text}}</span>
<span class="spacer"></span>
<span class="extension">{{extension}}</span>
</div>
</div>
</template>
Any help would be appreciated!