Skip to content

Instantly share code, notes, and snippets.

View cauldyclark15's full-sized avatar

Joselie Castaneda cauldyclark15

View GitHub Profile
import React from 'react';
import ReactDOM from 'react-dom';
import TodoTable from './all-todo';
class CreateTodo extends React.Component {
constructor () {
super();
this.state = {
count: 0,
data: []
}
import React from 'react';
import ReactDOM from 'react-dom';
import TodoTable from './all-todo';
class CreateTodo extends React.Component {
constructor () {
super();
this.state = {
count: 0,
data: []
}
@cauldyclark15
cauldyclark15 / fuzzyregex.js
Created August 4, 2017 01:20 — forked from samknight/fuzzyregex.js
Fuzzy Regex match
// This will allow unordered search terms to match relevant string
// e.g. Really Long String will be matched by
// - long string
// - long really
// - all ring
// ..etc
// I have used this anonymous function to override the matcher function in select2
function(term, text) {

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).

import React from 'react';
import PropTypes from 'prop-types';
import Downshift from 'downshift';
import {
InputWrapper,
InputMainWrapper,
ClearButtonWrapper,
} from './styles/fiddleStyles';
import CategoriesDropdown from './CategoriesDropdown';
import React, { Component } from 'react';
import Header from 'components/Header';
import PropTypes from 'prop-types';
import { withRouter, Link } from 'react-router-dom';
import { connect } from 'react-redux';
import { get, isEmpty } from 'lodash';
import { Wrapper } from './styles';
import Library from '../Library';
import BuilderMain from './partials/BuilderMain';
import DataLoader from 'dataloader';
import InventoryItemService from './InventoryItemService';
const cache = String(process.env.CACHE).toLowerCase() === 'true';
const inventoryItemService = new InventoryItemService();
export const inventoryItem = new DataLoader(
keys => Promise.all(keys.map(inventoryItemService.findById)),
import gql from 'graphql-tag';
import update from 'immutability-helper';
import { isEmpty } from 'lodash';
import { graphql } from 'react-apollo';
import {
accountInfo,
locationInfo,
meta,
notificationBasicInfo,
import React from 'react';
import Loadable from 'react-loadable';
import Spinner from 'react-spinkit';
import { Route, Switch, Redirect } from 'react-router-dom';
import AppContainer from './AppContainer';
import { Wrapper } from './styles';
const loader = <Spinner name="ball-spin-fade-loader" className="loader" />;
function LinkedList () {
let Node = function (element) {
this.element = element
this.next = null
}
let length = 0
let head = null
this.append = function (element) {