Avatar for Ethan_IRON

Ethan_IRON

Member since May 2022 • Last active Jun 2022
  • 1 conversations
  • 3 comments

Most recent activity

  • in JavaScript
    Avatar for Ethan_IRON

    oh... ok thank you

  • in JavaScript
    Avatar for Ethan_IRON

    Hi! i made a simple localStorage module to save my settings, maybe can help you
    This is a quick example on how to use it:

    var localStorage = require("localStorage").getInstance();

    var settingsObject = localStorage.getObject('settings');
    if (!settingsObject) {
    console.log("setting not exists");
    //here's how to set
    localStorage.setObject('settings', { 'ssid': 'blablabla', 'password': 'blablabla' });
    }
    else {
    console.log(settingsObject);
    //use the settings
    }

  • in JavaScript
    Avatar for Ethan_IRON

    Hi everybody, i'm creating a module for my tiny webserver framework and i have a problem with a module if is not required in the main javascript code.
    Let me explain better:
    in the main code i require module A that requires module C
    in the main code i require module B that requires module C
    i never need to require module C in the main code but if i don't do it the code dies when it require the module b because it says that module c does not exists...
    I attach the code (i only kept the code usefull to understand the problem)
    Is this an Espruino bug? can it be fixed? is it just a stupid idea? :D
    Thanks in advance

Actions