delete all local branches except master
Mac
git branch | grep -v "master" | xargs git branch -D
Windows
git branch -D @(git branch | select-string -NotMatch "master" | Foreach {$_.Line.Trim()})
{ | |
"cities": [ | |
{ | |
"id": "5907ace2192af335e137e738", | |
"name": "Amasya", | |
"districts": [ | |
{ | |
"id": "5907acfd79e1f73602127f2e", | |
"cityId": "5907ace2192af335e137e738", | |
"name": "Hamamözü", |
git branch | grep -v "master" | xargs git branch -D
git branch -D @(git branch | select-string -NotMatch "master" | Foreach {$_.Line.Trim()})
import Reactotron from 'reactotron-react-native' | |
import { reactotronRedux } from 'reactotron-redux' | |
import { AsyncStorage } from 'react-native' | |
const tron = Reactotron.configure() // AsyncStorage would either come from `react-native` or `@react-native-community/async-storage` depending on where you get it from // controls connection & communication settings | |
.useReactNative() // add all built-in react native plugins | |
.use(reactotronRedux()) // add all built-in react native plugins | |
.setAsyncStorageHandler(AsyncStorage) | |
.connect() // let's connect! |
const myArr = [{numbers:[1, 2, 3]}, {numbers:[4, 5, 6]}, {numbers:[7, 8, 9]}]; | |
/** Reducer array of objects to array of numbers */ | |
const myNewArr = myArr.reduce( | |
(acc, curr) => [...acc, ...curr.numbers], | |
[] //initialState | |
) | |
console.log(myNewArr) |
import { init } from '@rematch/core' | |
import * as models from './models' | |
const store = init({ models }) | |
export default store |
import React from 'react' | |
import { connect } from 'react-redux' | |
const Sayac = ({ deger, birEkle, birEkleAsync, yukleniyor }) => ( | |
<div> | |
<h1>Sayaç değeri = {deger}</h1> | |
<button | |
onClick={event => { | |
event.persist() | |
birEkle() |
// sayac modeli | |
export const sayac = { | |
state: { | |
yukleniyor: false, | |
deger: 0, | |
}, // saf hal/durum (initial state) | |
reducers: { | |
// saf fonksiyon | |
birEkle: state => ({ ...state, ...{ deger: state.deger + 1 } }), | |
yukleniyoruAyarla: (state, payload) => ({ ...state, ...{ yukleniyor: payload } }), |
import React from 'react' | |
import ReactDOM from 'react-dom' | |
import { Provider } from 'react-redux' | |
import store from './store' | |
import Sayac from './Sayac' | |
ReactDOM.render( | |
<Provider store={store}> | |
<Sayac /> | |
</Provider>, |
import React, { useState, useEffect } from 'react' | |
const StripeScriptLoader = ({ | |
children, | |
uniqueId, | |
script, | |
loader = 'Loading...', | |
}) => { | |
const [stripeLoaded, setStripeLoaded] = useState({}) | |
useEffect(() => { |
//.eslintrc | |
{ | |
"env": { | |
"browser": true, | |
"es6": true, | |
"commonjs": true | |
}, | |
"plugins": ["react"], | |
"extends": [ |