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
class SomeViewModel(private val locationRepository: LocationRepository) : ViewModel() { | |
// ... | |
private suspend fun fetchFromRemote() { | |
// Initialize some variables: | |
var gotObservedLocation = false // Did we get an observed location? | |
var isTimeout = false // Will be set to true once the timeout is reached | |
var timeoutMs = 500L // Timeout in ms |
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 { Directive, HostListener, Input, OnInit, Renderer2 } from '@angular/core'; | |
import { DomController } from '@ionic/angular'; | |
/** | |
* Moves away the header when scrolling down. | |
*/ | |
@Directive({ | |
selector: '[appHideHeader]', | |
}) | |
export class HideHeaderDirective implements OnInit { |