Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -------- | |
| const routes: Routes = [ | |
| { | |
| path: 'user', | |
| loadChildren: '../app/user/user.module#UserModule', | |
| data: { preload: true, delay: true } | |
| }, | |
| { | |
| path: 'admin', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -------- | |
| const routes: Routes = [ | |
| { | |
| path: 'user', | |
| loadChildren: '../app/user/user.module#UserModule', | |
| data: { preload: true } | |
| }, | |
| { | |
| path: 'admin', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { NgModule } from '@angular/core'; | |
| import { RouterModule, Routes } from '@angular/router'; | |
| import { CustomPreloadingStrategy } from './custom-preloading'; | |
| ------- | |
| ------- | |
| @NgModule({ | |
| imports: [ | |
| RouterModule.forRoot(routes, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | |
| } | |
| } |
NewerOlder