Skip to content

Instantly share code, notes, and snippets.

View yoovanr's full-sized avatar

Artem Misiura yoovanr

  • Connectd
  • Porto, Portugal
  • 17:32 (UTC -12:00)
  • LinkedIn in/yoovanr
View GitHub Profile
@yoovanr
yoovanr / client.js
Created May 1, 2020 17:33
[Vue] Vuex Module Example
import { instance } from '../../api'
const state = {
statsGeneral: [],
loadingStatsGeneral: true,
statsClients: [],
loadingStatsClients: true
}
@yoovanr
yoovanr / login.js
Last active May 1, 2020 17:29
[React Native] Login Screen Example
// We use react-hook-form library for form validations
// We use react-native-elements library for UI components
import React from 'react'
import { useSelector, useDispatch } from 'react-redux'
import { StatusBar, View, TextInput, ActivityIndicator } from 'react-native'
import { Button, Text } from 'react-native-elements'
import { useForm } from 'react-hook-form'
@yoovanr
yoovanr / webview.js
Created May 1, 2020 17:24
[React Native] Custom WebView Component Example
// We use useImperativeHandle for having ability to call methods from parent component.
// We use onMessage method from WebView for triggering needed states from any web apps.
import React, { forwardRef, useImperativeHandle, useRef, memo } from 'react'
import { WebView } from 'react-native-webview'
const WebViewLink = forwardRef(({ onMessage }, ref) => {
const webviewRef = useRef()
@yoovanr
yoovanr / actions.games.js
Last active May 1, 2020 17:23
[React] Action and Reducer Examples
import GamesService from '../../services/games'
import store from '../index'
function getGamesAction () {
return async (dispatch) => {
dispatch({ type: 'GET_GAMES_REQUEST'})
try {
const { data } = await GamesService.getGames()