Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
ember-cli-clock
Advanced tools
A very simple observable clock service for EmberJS.
I display time in many of my projects and need to keep the displayed time up-to-date so I generalized the solution to this Ember CLI Add-on.
ember install ember-cli-clock
Inject the clock
service: clock: Ember.inject.service()
. Now
you can observe changes like so for use with MomentJS:
App.TweetComponent = Ember.Component.extend({
posted: Ember.computed('clock.minute', function() {
return moment(this.get('timestamp')).fromNow();
})
});
{{posted}} outputs "2 minutes ago" and updates every minute
Or a clock that uses the local system time and updates every second.
App.ClockComponent = Ember.Component.extend({
time: Ember.computed('clock.second', function() {
return moment().format('h:m:s');
})
});
You can observe or display the following properties:
second
minute
five
quarter
hour
Each one is an incrementing integer.
During testing you may also set a custom interval time to speed up your tests.
For example use this.clock.set('intervalTime', 100);
to run the clock 10 times faster.
You may also reset the clock to 0 using this.clock.reset();
Copyright (c) 2014 Jerel Unruh and contributors
FAQs
The default blueprint for ember-cli addons.
The npm package ember-cli-clock receives a total of 139 weekly downloads. As such, ember-cli-clock popularity was classified as not popular.
We found that ember-cli-clock demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.