Skip to content

Instantly share code, notes, and snippets.

View joshjhargreaves's full-sized avatar

Josh Hargreaves joshjhargreaves

View GitHub Profile
@joshjhargreaves
joshjhargreaves / readme.md
Last active September 7, 2018 04:05
Consuming Blobs in a Native Module in React Native

Blob support landed in React Native in 0.54.

In effect this means you can hold a reference in JS to a resource which exists on the native side, and pass it to a native module without needing a round trip of the serialised data over the bridge and back.

JS side, you can retrieve a blob from fetch like so, which you can then pass to your native module.

const response = await fetch(BLOB_URL);
const blob = await response.blob();
...
blob.clear();
@jevakallio
jevakallio / reactiveconf-slam-poetry.md
Last active July 7, 2021 19:57
#ReactiveConf 2017 Lightning Talk Submission: JavaScript Slam Poetry

TL;DR: If you want to see me perform a spoken word poem about JavaScript in front of 1000 people (and on video), please ⭐ star this gist. If you're on mobile, you'll need to request desktop site.

JavaScript Slam Poetry

Javascript! Slam! Poetry!

@jevakallio
jevakallio / synchronized-scrolling.js
Created December 9, 2016 23:54
React Native: Synchronized ScrollViews
import Exponent from 'exponent';
import React from 'react';
import { range } from 'lodash';
import {
StyleSheet,
Dimensions,
ScrollView,
Animated,
Text,