A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
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 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(); |
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
Credit to | |
https://medium.com/javascript-in-plain-english/react-controlled-forms-with-hooks-538762aab935 | |
import React, { ChangeEvent, FormEvent, useReducer } from "react"; | |
const useForm = (initialState: any) => { | |
const reducer = ( | |
state: typeof initialState, | |
payload: { field: string; value: string } | |
) => { |
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, { forwardRef } from 'react' | |
import styled from 'styled-components' | |
import css, { get } from '@styled-system/css' | |
import { | |
system, | |
compose, | |
space, | |
color, | |
typography, | |
layout, |
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
// reducer.js | |
export const initialState = { | |
data: null | |
}; | |
const reducer = (state, action) => { | |
const reduced = { ...state }; | |
switch (action.type) { | |
case "FETCH_DATA": | |
return { |
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, {Component} from 'react' | |
import PropTypes from 'prop-types' | |
import {Route, Redirect} from 'react-router' | |
/** | |
* Component that protects route from unauthorized users. | |
* @type {Object} | |
*/ | |
class RouteAuth extends Component { | |
constructor(props) { |
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
'use strict'; | |
/** | |
* @ngdoc overview | |
* @name foundation.datepicker.angular | |
* @description | |
* # foundation.datepicker.angular | |
* | |
* Add angular support for {@link http://foundation-datepicker.peterbeno.com/example.html foundation-datepicker}. | |
*/ |
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
<?php | |
/** | |
* By default instagram doesn't allow us to query for more than | |
* attribute, such as media posted by a specific author tagged with | |
* a specific tag. In order to accomplish this we will acquire all of | |
* the media tagged with the tag we are looking for and then filter it | |
* down based on the user. | |
*/ |
Leverages Angular UI Router instead of core ngRoute
module. UI Router
allows
us to organize our application interface into a state machine.
Unlike the $route
service in the Angular ngRoute
module, which is organized around URL routes, UI-Router
is organized around states, which may optionally have routes, as well as other behavior, attached.
LIFT* Organization principle:
- L - Locating code easy
- I - Identify code at a glance
NewerOlder