Skip to content

Instantly share code, notes, and snippets.

View egin10's full-sized avatar
:octocat:
Work from home

Ginanjar S.B egin10

:octocat:
Work from home
View GitHub Profile
@egin10
egin10 / ImageRepositories.php
Last active January 19, 2020 04:48
Storing Image Laravel API
<?php
namespace App\Repositories;
use Illuminate\Support\Str;
class Image {
public function actionImage($nameOldImage = null, $method = null)
{
if($method = "DELETE_IMAGE"){
@egin10
egin10 / Component.js
Last active October 3, 2019 04:10
Create Redux for ReactJs
// Use connect to use Store and Dispatch
import { connect } from'react-redux'
// Use todoAction from todoAction.js
import { addTodo } from './todoAction'
/*
use this syntax to access the store => this.state.todos
component(this.state.todos)
{
"posts": [
{
"userId": 1,
"id": 1,
"title": "Echo Foxtrot Golf Hotel Lima Delta Bravo November Alfa Tango Zulu Juliett Papa Romeo Kilo Mike Uniform Quebec",
"body": "morbi non lectus aliquam sit amet diam in magna bibendum imperdiet nullam orci pede venenatis",
"likes": 0,
"dislikes": 0
},