Skip to content

Instantly share code, notes, and snippets.

@VeraZab
VeraZab / constructors.js
Created February 11, 2018 21:30
When do we need constructors and super in Es6 classes?
/*
* Each class has a .prototype property that by default contains a constructor
* property that points back at the class itself.
*/
class Example {}
console.warn(Example === Example.prototype.constructor);
/*
* We can use the constructor method when we want to set some defaults on a class.
@VeraZab
VeraZab / LocalNotifications.js
Last active February 26, 2023 23:26
Simple local notification with Expo
import React, {Component} from 'react';
import {TextInput, View, Keyboard} from 'react-native';
import {Constants, Notifications, Permissions} from 'expo';
export default class Timer extends Component {
onSubmit(e) {
Keyboard.dismiss();
const localNotification = {
title: 'done',