Skip to content

Commit

Permalink
Use dunno package to get a result
Browse files Browse the repository at this point in the history
  • Loading branch information
melanieseltzer committed Feb 6, 2019
1 parent af9fa8a commit eca5a3f
Show file tree
Hide file tree
Showing 7 changed files with 348 additions and 307 deletions.
4 changes: 2 additions & 2 deletions src/components/App/App.tsx
Expand Up @@ -7,7 +7,7 @@ import LoadFonts from '../../fonts';
import Form from '../Form';
import Layout from '../Layout';

import { config } from '../../utils/config';
import { config } from '../../utils';

class App extends Component {
state = {
Expand All @@ -34,7 +34,7 @@ class App extends Component {
});
};

updateResult = (result: string | boolean) => {
updateResult = (result: string | number | boolean) => {
// if result comes back false it means there was an error
// so set error to true
if (!result) {
Expand Down
5 changes: 2 additions & 3 deletions src/components/Form/Form.tsx
@@ -1,10 +1,9 @@
import React, { Component } from 'react';
import styled from 'styled-components';
import dunno from 'dunno';

import Input from '../Input';

import { getResult } from '../../utils/helpers';

interface Props {
updateResult: (result: string | boolean) => void;
}
Expand All @@ -28,7 +27,7 @@ class Form extends Component<Props> {
const { updateResult } = this.props;

// make a decision using each input value and get a result
const result = getResult(firstInput, secondInput);
const result = dunno([firstInput, secondInput]);

// update parent state with this result using the function
// passed via props
Expand Down
22 changes: 0 additions & 22 deletions src/utils/helpers.test.ts

This file was deleted.

11 changes: 0 additions & 11 deletions src/utils/helpers.ts

This file was deleted.

File renamed without changes.
3 changes: 2 additions & 1 deletion tslint.json
Expand Up @@ -16,6 +16,7 @@
"member-access": false,
"jsx-no-lambda": false,
"jsx-boolean-value": false,
"object-literal-sort-keys": false
"object-literal-sort-keys": false,
"ordered-imports": false
}
}

0 comments on commit eca5a3f

Please sign in to comment.