Skip to content

Instantly share code, notes, and snippets.

Avatar

Emilio Navarro emilionavarro

View GitHub Profile
@indiesquidge
indiesquidge / objects-over-classes.md
Last active May 1, 2021
We are better off avoiding ES6 classes in JavaScript when possible
View objects-over-classes.md

Plain JavaScript objects are better than classes when they can be used, and many popular modern frameworks have adopted their use.

Consider that in React a component can be created as either a class or as an object.

// using a class
class Welcome extends React.Component {
  render() {
    <h1>Hello, {this.props.name}</h1>
@chaeplin
chaeplin / esp8266_fpm_mdem_sleep.ino
Created Jan 26, 2016
esp8266_fpm_mdem_sleep.ino
View esp8266_fpm_mdem_sleep.ino
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include "/usr/local/src/ap_setting.h"
extern "C" {
#include "user_interface.h"
}
#define FPM_SLEEP_MAX_TIME 0xFFFFFFF