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
{ | |
"foundations": { | |
"color": { | |
"background": { | |
"primary": { | |
"value": "#ffffff", | |
"filePath": "tokens/foundations/color/background.json", | |
"isSource": true, | |
"original": { | |
"value": "#ffffff" |
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
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) => { |
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
//... | |
const HtmlWebpackPlugin = require("html-webpack-plugin"); | |
//... | |
/** | |
* webpack config | |
*/ | |
module.exports = { | |
//... | |
plugins: [ |
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
//... | |
const ScriptExtHtmlWebpackPlugin = require("script-ext-html-webpack-plugin"); | |
/** | |
* webpack config | |
*/ | |
module.exports = { | |
// entry files | |
entry: { | |
["my-page"]: "./src/my-page.js" |
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
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"); | |
//... | |
/** |
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
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"); |
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
{ | |
"type": "PRODUCT_GET_BY_ID_SUCCESS", | |
"payload": { | |
"id": 3, | |
"name": "A Dog", | |
"price": 25 | |
}, | |
"errors": null | |
} |
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
public interface IApuxActionResult : IApuxAction | |
{ | |
bool Dispatch { get; set; } | |
JToken Payload { get; set; } | |
List<ApuxError> Errors { get; set; } | |
} |
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
public class ProductActionDispatcher : IApuxActionDispatcher | |
{ | |
.... | |
public IApuxActionResult Dispatch(ApuxAction<JToken> actionRequest) | |
{ | |
switch (actionRequest.Type) | |
{ | |
.... | |
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
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 |
NewerOlder