Skip to content

Instantly share code, notes, and snippets.

Avatar
🙂
Working

Hussain Sherwani hussainahmad

🙂
Working
View GitHub Profile
View Deep Link Instrumented Test
View Layout.js
import { Dimensions } from 'react-native';
const width = Dimensions.get('window').width;
const height = Dimensions.get('window').height;
export default {
window: {
width,
height,
},
@hussainahmad
hussainahmad / ReactModal
Last active Mar 3, 2021
Custom ReactModal with fully custom support having OK and Cancel button
View ReactModal
import React from "react";
import {Text, View, TouchableOpacity} from "react-native";
import Theme from "../utill/Color";
import Modal from 'react-native-modal';
import Layout from "../utill/Layout";
const ReactModal = (props) => {
return (
<Modal
@hussainahmad
hussainahmad / group-objects-by-property.md
Created Feb 9, 2022 — forked from JamieMason/group-objects-by-property.md
Group Array of JavaScript Objects by Key or Property Value
View group-objects-by-property.md

Group Array of JavaScript Objects by Key or Property Value

Implementation

const groupBy = key => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = obj[key];
    objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
    return objectsByKeyValue;