This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// An example 'TodoItems' schema with 'dueDate' using 'datetime' | |
var db = new Vasern({ schema: { | |
name: "TodoItems", | |
props: { | |
name: "string", | |
dueDate: "datetime" | |
} | |
}}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Enum { | |
constructor(type) { | |
Enum.initEnumType(type); | |
this.type = type; | |
} | |
/** | |
* Initate enum values ** Internal use only | |
* Iterate through given values and intiate enum value object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* VersionControlObject allow you versioning an object, | |
* which show number of updates, go back and ford between the version. | |
* --------------------------------------------------------------------------------------------------- | |
* This is a typescript version with minor updates based on trincot answer on stackoverflow | |
* https://stackoverflow.com/a/40498130/5775993 | |
*/ | |
export class VersionControlObject<T> { | |
targets: any[] = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from "react"; | |
import MyDB from "./conn"; | |
import { | |
View, Text | |
} from "react-native"; | |
export function App() { | |
const [items, setItems] = useState(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ISO 3166-1 alpha-2 | |
// ⚠️ No support for IE 11 | |
// Source: all over the internet | |
function countryToFlag(code) { | |
let isoCode = code.split("-").pop() | |
return typeof String.fromCodePoint !== 'undefined' | |
? isoCode | |
.toUpperCase() | |
.replace(/./g, (char) => String.fromCodePoint(char.charCodeAt(0) + 127397)) | |
: isoCode; |