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 { contains } from "ramda" | |
export class ComponentTest extends React.Component<Props, State> { | |
constructor(props: Props) { | |
super(props); | |
this.state = {} | |
} | |
_function = () => { |
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 * as React from "react" | |
import { View } from "react-native" | |
import { ApiStore } from "../../services/api/api-store" | |
import { inject } from "mobx-react" | |
export interface FirstExampleScreenProps extends NavigationScreenProps<{}> { | |
apiStore: ApiStore, | |
} | |
@inject("apiStore") |
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
... | |
return ( | |
<Provider rootStore={rootStore} navigationStore={rootStore.navigationStore} apiStore={rootStore.apiStore} {...otherStores}> | |
<BackButtonHandler canExit={this.canExit}> | |
<StatefulNavigator /> | |
</BackButtonHandler> | |
</Provider> | |
) | |
} |
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 { Instance, SnapshotOut, types } from "mobx-state-tree" | |
import { NavigationStoreModel } from "../../navigation/navigation-store" | |
import { ApiStoreModel } from "../../services/api/api-store" | |
/** | |
* An RootStore model. | |
*/ | |
export const RootStoreModel = types.model("RootStore").props({ | |
navigationStore: types.optional(NavigationStoreModel, {}), | |
apiStore: types.optional(ApiStoreModel, {}), |
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 { Instance, types, getEnv } from "mobx-state-tree" | |
export const ApiStoreModel = types | |
.model() | |
.props({ | |
}) | |
.actions(self => ({ | |
test(){ | |
return getEnv(self).api.getUser('1'); | |
}, |
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 API_SERVICE from './api'; | |
export default { | |
async get() { | |
return await API_SERVICE.get() | |
.then((res) => { | |
// L'appel API est arrivé au bout | |
return res; | |
}) | |
.catch((err) => { |
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 * as env from "../../environment-variables" | |
export default { | |
get() { | |
let didTimeout = false; | |
return new Promise((resolve, reject) => { | |
const timeout = setTimeout(() => { | |
didTimeout = true; | |
reject(new Error('Request timed out')); |
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 * as ls from "../../utils/storage" | |
export class ComponentTest extends React.Component<Props, State> { | |
constructor(props: Props) { | |
super(props); | |
this.state = {} | |
} | |
_saveString = () => { |
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 * as React from "react" | |
import { View, Text } from "react-native" | |
export interface Props { | |
propsVar: any; | |
} | |
export interface State { | |
stateVar: any; | |
} |
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
- Se placer dans le dossier où l'on voudra avoir la vidéo | |
- Lancer la capture: | |
`adb shell screenrecord /sdcard/nom_de_la_video.mp4` | |
- Stopper la capture: | |
`CTRL + C` |