added 260907 version of worker toolkit

This commit is contained in:
2026-09-08 20:30:51 -04:00
parent cbd3f0f8ca
commit 97aca37663
1283 changed files with 142951 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
import Ember from 'ember';
const {
get,
Service,
getProperties,
} = Ember;
export default Service.extend({
limit: 10,
history: [],
pushEntry(entry) {
const { limit, history } = getProperties(this, 'limit', 'history');
history.pushObject(entry);
if (history.length > limit) {
history.shiftObject();
}
},
popEntry() {
const history = get(this, 'history');
if (history.length < 2) {
return null;
}
history.popObject(); //skip current
return history.popObject() || history.popObject(); //skip nulls, which are present for "skip this route" feature
},
});