@xtia/jel 0.5.0 → 0.5.1

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.
@@ -126,10 +126,10 @@ export class EventEmitter extends Emitter {
126
126
  return new EventEmitter(listen);
127
127
  }
128
128
  throttle(ms) {
129
- let lastTime = 0;
129
+ let lastTime = -Infinity;
130
130
  const listen = this.transform((value, emit) => {
131
- const now = Date.now();
132
- if (now < lastTime + ms) {
131
+ const now = performance.now();
132
+ if (now >= lastTime + ms) {
133
133
  lastTime = now;
134
134
  emit(value);
135
135
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xtia/jel",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "repository": {
5
5
  "url": "https://github.com/tiadrop/jel-ts",
6
6
  "type": "github"