Skip to content

Instantly share code, notes, and snippets.

View thidasapankaja's full-sized avatar

Thidasa Pankaja Paranavitharana thidasapankaja

View GitHub Profile
@thidasapankaja
thidasapankaja / signup.js
Created July 17, 2018 04:20
Action Creator for Signup
import * as types from '../constants/action_types';
import axios from 'axios';
export const signup = (user) => {
console.log(user);
return async dispatch => {
try {
const response = await axios.get('http://localhost:5000/api/user/register', user)
const data = {response}
dispatch({
@thidasapankaja
thidasapankaja / index.js
Last active July 17, 2018 04:20
Signup component
import React, { Component } from 'react';
import {
Link,
withRouter,
} from 'react-router-dom';
import { auth } from '../../firebase';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { signup } from './../../actions/signup';