Skip to content

Instantly share code, notes, and snippets.

@mattquest
mattquest / Form.js
Created November 29, 2019 03:47
Javascript form class for use on Laravel frontend.
class Form {
constructor(url, fields) {
this.url = url
this.originalFields = { ...fields }
this.fields = fields
this.errors = {}
}
async post() {
let result = null
result = axios.post(this.url, this.fields)
@mattquest
mattquest / WhButton.tsx
Created October 18, 2019 15:24
A simple button component for react-native / react-navigation written in typescript.
/**
* WhButton
* a simple button component for react-native / react-navigation
* written in typescript, tested with:
* - react-native 0.59.8
* - react-navigation 4.0.10
*/
import React from 'react'
import { Text, StyleSheet } from 'react-native';