Skip to content
This repository was archived by the owner on Nov 3, 2025. It is now read-only.

Commit 2c7cb11

Browse files
authored
Merge pull request #57 from tpucci/canal/state
Add createCanal declarative usage
2 parents c99d4b7 + b6c28d2 commit 2c7cb11

29 files changed

Lines changed: 482 additions & 93 deletions

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
This file was deleted.

.npmignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,10 @@ example
66

77
# Coverage
88
coverage
9+
10+
# VSCode
11+
.vscode
12+
13+
# Jest
14+
__mocks__
15+
jest

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"jest.showCoverageOnLoad": true,
66
"typescript.validate.enable": true,
77
"npm.packageManager": "yarn",
8-
"eslint.packageManager": "yarn"
8+
"eslint.packageManager": "yarn",
9+
"prettier.tslintIntegration": true
910
}

__mocks__/react.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* useEffect does not trigger on render.
3+
* See https://github.com/facebook/react/issues/14050#issuecomment-438173736.
4+
* @TODO 2019-05-15 Check if this can be removed
5+
*/
6+
7+
const React = require.requireActual('react');
8+
module.exports = { ...React, useEffect: React.useLayoutEffect };

babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module.exports = {
22
presets: ['module:metro-react-native-babel-preset'],
3+
plugins: [['@babel/plugin-proposal-decorators', { legacy: true }]],
34
};

example/babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module.exports = {
22
presets: ['module:metro-react-native-babel-preset', '@babel/preset-typescript'],
3+
plugins: [['@babel/plugin-proposal-decorators', { legacy: true }]],
34
};

example/metro.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ module.exports = {
1919
// See https://github.com/facebook/metro/issues/7#issuecomment-464668678.
2020
mobx: path.resolve(__dirname, '../node_modules/mobx'),
2121
'mobx-react': path.resolve(__dirname, '../node_modules/mobx-react'),
22+
'mobx-utils': path.resolve(__dirname, '../node_modules/mobx-utils'),
2223
react: path.resolve(__dirname, '../node_modules/react'),
2324
'react-native': path.resolve(__dirname, '../node_modules/react-native'),
25+
'@babel/plugin-proposal-decorators': path.resolve(__dirname, '../node_modules/@babel/plugin-proposal-decorators'),
2426
},
2527
},
2628
transformer: {

example/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"start": "node ../node_modules/react-native/local-cli/cli.js start",
77
"test:lint": "cd .. && yarn tslint example/src/**/*.ts{,x} && cd example",
88
"test:unit": "cd .. && yarn jest --config=example/jest.config.js && cd example",
9+
"test:unit:u": "cd .. && yarn jest --config=example/jest.config.js -u && cd example",
910
"test:unit:ci": "cd .. && yarn jest --config=example/jest.config.js --runInBand && cd example",
1011
"test:type": "tsc --noEmit",
1112
"test": "yarn test:lint && yarn test:unit && yarn test:type",

example/src/App.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import React, { Component } from 'react';
2-
import { NavigationProvider } from 'react-gondola';
32
import { SignIn } from './canals/SignIn';
43

54
interface IProps {}
65
export default class App extends Component<IProps> {
76
render() {
8-
return (
9-
<NavigationProvider>
10-
<SignIn />
11-
</NavigationProvider>
12-
);
7+
return <SignIn />;
138
}
149
}
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import React, { Component } from 'react';
2-
import { StyleSheet, Text, View } from 'react-native';
2+
import { StyleSheet, Text, View, Button, TextInput } from 'react-native';
33

44
interface IProps {}
55
export class FirstName extends Component<IProps> {
66
render() {
77
return (
88
<View style={styles.container}>
9-
<Text>FirstName</Text>
9+
<Text>Waht is your first name ?</Text>
10+
<TextInput placeholder="Type here" />
11+
<Button title="Next" onPress={() => true} />
1012
</View>
1113
);
1214
}
@@ -17,6 +19,6 @@ const styles = StyleSheet.create({
1719
alignItems: 'center',
1820
backgroundColor: '#FFAAAA',
1921
flex: 1,
20-
justifyContent: 'center',
22+
justifyContent: 'space-around',
2123
},
2224
});

0 commit comments

Comments
 (0)