Skip to content

Instantly share code, notes, and snippets.

class BackController extends Component {
static propTypes = {
onBack: PropTypes.func.isRequired
}
componentDidMount = () =>
BackHandler.addEventListener('hardwareBackPress', this.handleBack)
componentWillUnmount = () =>
BackHandler.removeEventListener('hardwareBackPress', this.handleBack)
@JodusNodus
JodusNodus / SomeView.js
Last active August 1, 2017 19:49
Declarative logic React components
class SomeView extends Component {
static propTypes = {
showNav: PropTypes.func.isRequired,
hideNav: PropTypes.func.isRequired
}
componentDidMount(){
this.props.showNav()
BackHandler.addEventListener('hardwareBackPress', this.handleBack)
}
componentWillUnmount(){

Keybase proof

I hereby claim:

  • I am jodusnodus on github.
  • I am jodusnodus (https://keybase.io/jodusnodus) on keybase.
  • I have a public key ASAIKw3uAxnnULR0h8iSO3W4HyO5jLmp3uZgfu42QM1vYgo

To claim this, I am signing this object:

@JodusNodus
JodusNodus / syncthing
Last active January 17, 2021 22:14 — forked from arudmin/syncthing
/etc/init.d/syncthing
#!/bin/sh
### BEGIN INIT INFO
# Provides: syncthing
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Multi-user daemonized version of syncthing.