This file contains hidden or 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 Result = (props) => { | |
| return ( | |
| <div>{props.counter}</div> | |
| ); | |
| } | |
| class Button extends React.Component { | |
| handleClick = () => { | |
| this.props.onClickFunction(this.props.incrementValue); |
This file contains hidden or 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
| class Button extends React.Component { | |
| render () { | |
| return ( | |
| <button onClick={this.props.onClickFunction}>+1</button> | |
| ) | |
| } | |
| } | |
| const Result = (props) => { | |
| return ( |
This file contains hidden or 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
| class Button extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { counter : 0 }; | |
| } | |
| render() { | |
| return ( | |
| <button onClick={this.handleClick}>{this.state.counter}</button> | |
| ); |
This file contains hidden or 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
| angular | |
| .module('demoModule') | |
| .factory('$exceptionHandler', ['$injector', function ($injector) { | |
| return function (...args) { | |
| var http = $injector.get('$http'); | |
| var info = { | |
| exception: args[0], | |
| cause: args[1] | |
| }; |
This file contains hidden or 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 LogService | |
| { | |
| private readonly DbContext _context; | |
| public LogService(DbContext context) | |
| { | |
| this._context = context; | |
| } | |
| public async Task LogException(ErrorLog log) |
This file contains hidden or 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
| function suspiciousService($q) { | |
| this.doVeryImportantStuff = function (options) { | |
| if (options.throwException) { | |
| throw 'An exception thrown as per required options.' | |
| } | |
| return $q.resolve({ data: 'Data without exception.' }); | |
| } | |
| } |
This file contains hidden or 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
| function suspiciousController($scope, $log, suspiciousService) { | |
| var options = { | |
| throwException: false // change to false in case no exception is to be thrown. | |
| }; | |
| $scope.doImportantStuff = function () { | |
| try { | |
| suspiciousService.doVeryImportantStuff(options) | |
| .then(function (promisedData) { | |
| // Do something with promised data. |
This file contains hidden or 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
| function suspiciousController($scope, $log, suspiciousService) { | |
| var options = { | |
| throwException: true // change to false in case no exception is to be thrown. | |
| }; | |
| $scope.doImportantStuff = function () { | |
| suspiciousService.doVeryImportantStuff(options) | |
| .then(function (promisedData) { | |
| // Do something with promised data. | |
| $log.log('Doing something with promised data', promisedData); |
This file contains hidden or 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 = require('webpack'), | |
| HtmlWebpackPlugin = require('html-webpack-plugin'); | |
| module.exports = { | |
| entry: { | |
| app: ['./src/app/App.tsx', 'webpack-hot-middleware/client'], | |
| vendor: ['react', 'react-dom'] | |
| }, | |
| output: { |
This file contains hidden or 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
Show hidden characters
| { | |
| "compilerOptions": { | |
| "allowSyntheticDefaultImports": true, | |
| "jsx": "react", | |
| "module": "commonjs", | |
| "noImplicitAny": true, | |
| "outDir": "./build/", | |
| "preserveConstEnums": true, | |
| "removeComments": true, | |
| "sourceMap": true, |