Skip to content

Instantly share code, notes, and snippets.

View dan-harris's full-sized avatar
🥓
Contemplating bacon.

Dan Harris dan-harris

🥓
Contemplating bacon.
View GitHub Profile
{
"foundations": {
"color": {
"background": {
"primary": {
"value": "#ffffff",
"filePath": "tokens/foundations/color/background.json",
"isSource": true,
"original": {
"value": "#ffffff"
@dan-harris
dan-harris / promise-utils.js
Created May 3, 2019 03:21
some utils for working with promises in a stream-type fashion (inspired by rxjs functions)
const merge = (...promises) => (currentValue = null) =>
Promise.all(promises).then(promiseValues => {
if (!currentValue) return promiseValues;
else
return Array.isArray(currentValue)
? [...currentValue, ...promiseValues]
: [currentValue, ...promiseValues];
});
const tap = (tapFunction = (...args) => null) => (currentValue = null) => {
//...
const HtmlWebpackPlugin = require("html-webpack-plugin");
//...
/**
* webpack config
*/
module.exports = {
//...
plugins: [
//...
const ScriptExtHtmlWebpackPlugin = require("script-ext-html-webpack-plugin");
/**
* webpack config
*/
module.exports = {
// entry files
entry: {
["my-page"]: "./src/my-page.js"
const path = require("path");
/**
* webpack & plugins
*/
const webpack = require("webpack");
//...
const StyleExtHtmlWebpackPlugin = require("style-ext-html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
//...
/**
const path = require("path");
/**
* webpack & plugins
*/
const webpack = require("webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const ScriptExtHtmlWebpackPlugin = require("script-ext-html-webpack-plugin");
const StyleExtHtmlWebpackPlugin = require("style-ext-html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
{
"type": "PRODUCT_GET_BY_ID_SUCCESS",
"payload": {
"id": 3,
"name": "A Dog",
"price": 25
},
"errors": null
}
public interface IApuxActionResult : IApuxAction
{
bool Dispatch { get; set; }
JToken Payload { get; set; }
List<ApuxError> Errors { get; set; }
}
public class ProductActionDispatcher : IApuxActionDispatcher
{
....
public IApuxActionResult Dispatch(ApuxAction<JToken> actionRequest)
{
switch (actionRequest.Type)
{
....
public class RootActionDispatcher : IApuxActionRootDispatcher
{
....
public IApuxActionResult RootDispatch(IApuxAction actionRequest)
{
// Get action namespace
var actionNamespace = actionRequest.Type.Split(Constants.ACTION_NAMESPACE_SEPERATOR)[0];
// instantiate a new action for the request