Skip to content

Instantly share code, notes, and snippets.

View muthudevendra's full-sized avatar

Muthu Devendra muthudevendra

  • Berlin
View GitHub Profile
@muthudevendra
muthudevendra / catclass.svg
Last active October 13, 2023 12:41
cat with class name
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@muthudevendra
muthudevendra / cat.svg
Last active October 13, 2023 11:34
cat-svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@muthudevendra
muthudevendra / app.tsx
Last active June 17, 2020 12:42
React-native shareable component - 3
import React, { useState } from 'react';
import RadioButton from './src/components/radio-button/radio-button';
import { View, StyleSheet } from 'react-native';
const App = () => {
const [ radio, setRadio ] = useState('');
const data = [
{
label: 'Value One',
value: 'valueOne'
@muthudevendra
muthudevendra / radio-button.tsx
Last active June 17, 2020 12:42
React-native shareable component - 2
import React from 'react';
import { Text, TouchableOpacity, View } from 'react-native';
import styles from './styles';
const RadioButton = (props: any) => {
const { buttonContainer, button, checkedButton } = styles;
return (
<View style={ buttonContainer }>
@muthudevendra
muthudevendra / radio-button.tsx
Last active August 3, 2019 08:28
React-native shareable component - 1
import React from 'react';
import { Text, View } from 'react-native';
import styles from './styles';
const RadioButton = (props: any) => {
const { buttonContainer } = styles;
return (
<View style={buttonContainer}>
@muthudevendra
muthudevendra / custom-preloading.ts
Last active February 2, 2019 16:38
class custom-preloading.ts with delay
import { PreloadingStrategy, Route } from '@angular/router';
import { Observable } from 'rxjs/Observable';
export class CustomPreloadingStrategy implements PreloadingStrategy {
preload(route: Route, load: Function): Observable<any> {
const loadRoute = (delay) => delay
? timer(10000).pipe(flatMap(_ => load()))
: load();
return route.data && route.data.preload
? loadRoute(route.data.delay)
@muthudevendra
muthudevendra / app-routing.module.ts
Last active June 25, 2019 12:31
Preloading startegy app-routing.module.ts with delay
--------
const routes: Routes = [
{
path: 'user',
loadChildren: '../app/user/user.module#UserModule',
data: { preload: true, delay: true }
},
{
path: 'admin',
@muthudevendra
muthudevendra / app-routing.module.ts
Last active January 17, 2019 03:56
Preloading startegy app-routing.module.ts routes with preloading
--------
const routes: Routes = [
{
path: 'user',
loadChildren: '../app/user/user.module#UserModule',
data: { preload: true }
},
{
path: 'admin',
@muthudevendra
muthudevendra / app-routing.module.ts
Last active January 17, 2019 03:56
Preloading startegy app-routing.module.ts import
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CustomPreloadingStrategy } from './custom-preloading';
-------
-------
@NgModule({
imports: [
RouterModule.forRoot(routes,
import { PreloadingStrategy, Route } from '@angular/router';
import { Observable } from 'rxjs/Observable';
export class CustomPreloadingStrategy implements PreloadingStrategy {
preload(route: Route, load: Function): Observable<any> {
return route.data && route.data.preload ? loadRoute(route.data.delay): of(null);
}
}