Comments (3)
This should really be a bug report for in Espruino.
But: While I can see it would be useful, I'm not sure:
setInterval(foo, 60000, { execNow : true });
is really any more obvious than:
setInterval(foo, 60000);
foo();
or:
setInterval(foo, 60000);
setTimeout(foo, 1);
I just don't think it's a good idea - mainly because setInterval is something that's used all over the place and is basically a standard (web browsers, node, etc) and changing the behaviour would be bad news.
from espruinodocs.
Should be in Espruino, again, my apologies.
I leave this one up to you. Another option would be to introduce a new function that just wraps the setInterval and the direct execution in one. I have used this construct a lot so far, so I would argue that it is a fairly typical use case.
from espruinodocs.
Sorry - I'm going to close this one. Nobody else has had problems with the old implementation, and you could easily just write the following at the top of your code:
function setIntervalNow(a,b,c) {
a();
return setInterval(a,b,c);
}
from espruinodocs.
Related Issues (20)
- Bangle2.js Firmware Source Code and Hardware Schematic HOT 3
- [tutorials/BLE Advertising.md] Python section, not using sudo with pip HOT 1
- STM32F4DISCOVERY with different accelerometer HOT 2
- Data Streaming To GCP HOT 1
- [Hardware Reference - SetUI] HOT 3
- info/Compilation.md HOT 1
- info/Font Converter.md HOT 3
- KeyPad return values HOT 1
- Docs not built correctly HOT 1
- ST7735 on ESP32 using hardware SPI HOT 3
- graph module bug HOT 1
- Add "Bangle.js Battery Load/Intensity notes" HOT 2
- Reference pages layout improvements HOT 4
- Forum isn't redirecting correctly HOT 1
- tutorials/Software PWM.md HOT 1
- There is no maximum PW rate specified for the puck.js2 HOT 1
- Add Ungoogled Chromium and Bromite to docs as a FOSS alternative HOT 2
- New tutorial: How to rapidly build and test Espruino for banglejs2 HOT 2
- tutorials/Tiny Word Clock.md HOT 7
- Mouldking module not working, possibly wrong device address? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from espruinodocs.