Skip to content

Instantly share code, notes, and snippets.

View smontlouis's full-sized avatar

Montlouis-Calixte Stéphane smontlouis

  • Freelance
  • Annecy
View GitHub Profile
@nikasepiskveradze
nikasepiskveradze / react-query-lite.js
Last active March 11, 2024 17:45
Lightweight implementation of React Query
import React from "react";
const context = React.createContext();
export function QueryClientProvider({ children, client }) {
React.useEffect(() => {
const onFocus = () => {
client.queries.forEach((query) => {
query.subscribers.forEach((subscriber) => {
subscriber.fetch();
@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',
@knowbody
knowbody / ex-navigation.md
Last active July 17, 2023 10:14
My exponent's ex-navigation docs/thoughts

Exponent - ex-navigation

This is for now, for my personal use only, things might not be correctly explained here. For the official docs please check: https://github.com/exponentjs/ex-navigation/blob/master/README.md

Navigation bar configuration

On every screen you can use the built-in navigation bar, you can add a title, left button, right button or change navigation bar’s style. All you need to do is pass appropriate params to navigationBar in the route configuration:

import React, { Component } from 'react';
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
/**
* @providesModule PatientList
*/
import NavigationBar from 'react-native-navbar';
import NavigationButtons from 'NavigationButtons';
import React, { ListView, Navigator, StyleSheet, Text, TextInput, TouchableHighlight, View } from 'react-native';
import { connect } from 'react-redux/native'
@connect(state => ({
patients: state.patients
@gaearon
gaearon / combining.js
Created June 3, 2015 18:03
Combining Stateless Stores
// ------------
// counterStore.js
// ------------
import {
INCREMENT_COUNTER,
DECREMENT_COUNTER
} from '../constants/ActionTypes';
const initialState = { counter: 0 };
@XeeD
XeeD / README.md
Last active September 1, 2016 15:54
Este.js and react-transmit

Data fetching for Este with react-transmit

1) Without server rendering

Read the DOCS.

This is easy and straightforward. All you need is to add react-transmit into dependencies (npm install --save react-transmit). Transmit works as a Higher-order component so instead of

export default class Dashboard extends PureComponent {
 // ...
@RReverser
RReverser / better-console-log.js
Last active May 9, 2019 21:07
Better console.log in Node
// UPD:
// Now available as npm module!
// Check out https://github.com/RReverser/better-log for details.
console.log = (function (log, inspect) {
return function () {
return log.apply(this, Array.prototype.map.call(arguments, function (arg) {
return inspect(arg, { depth: 1, colors: true });
}));
};

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@staltz
staltz / introrx.md
Last active April 25, 2024 04:18
The introduction to Reactive Programming you've been missing