One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
#!/usr/bin/env bash | |
# | |
# gh-dl-release! It works! | |
# | |
# This script downloads an asset from latest or specific Github release of a | |
# private repo. Feel free to extract more of the variables into command line | |
# parameters. | |
# | |
# PREREQUISITES | |
# |
#!/usr/bin/env babel-node | |
require('dotenv').config() | |
import contentful from 'contentful' | |
import fs from 'fs-extra-promise' | |
// Contentful Config | |
const apiToken = process.env.CONTENTFUL_DELIVERY_API_TOKEN | |
const spaceId = process.env.CONTENTFUL_SPACE_ID | |
const client = contentful.createClient({ accessToken: apiToken, space: spaceId }) |
This Gist provides some code examples of how to implement WebSocket stream handling using a Redux middleware. Please be aware that this is only provided as an example and that critical things like exception handling have not been implemented.
A more complete version has been packaged, tested, and is available on GitHub as redux-websocket. This library has also been published to npm at @giantmachines/redux-websocket
.
This module represents the foundation of the middleware and implements the ideas presented above. The exported function is used during the creation of the Redux store (see the following snippet).
import axios from 'axios' | |
let mockingEnabled = false | |
const mocks = {} | |
export function addMock(url, data) { | |
mocks[url] = data | |
} |
it('returns an object containing all users', done => { | |
// create and configure the fake server to replace the native network call | |
const server = sinon.createFakeServer() | |
server.respondWith('GET', '/users', [ | |
200, | |
{ 'Content-Type': 'application/json' }, | |
'[{ "id": 1, "name": "Gwen" }, { "id": 2, "name": "John" }]' | |
]) |
Steps to publish a npm package to beta that won't be available via latest and won't auto install on ncu updates etc
npm run dist
etc"version": "0.1.120-beta.1"
where beta.x is the number of those betasnpm publish --tag beta
There are two options for install:
npm install packagename@beta
npm install [email protected]
import React from "react"; | |
import { BrowserRouter as Router } from "react-router-dom"; | |
import { Routes, Link, RouteDefinition } from "./router"; | |
const Home: React.FC<{}> = () => { | |
return ( | |
<> | |
<h1>Home</h1> | |
<p><Link name="hello" params={{name: "World"}}>Hello World</Link></p> | |
<p><Link name="hello" params={{name: "Bob"}}>Hello Bob</Link></p> |