0.1.27 • Published 2 years ago
react-native-upper v0.1.27
react-native-upper
Simple
Installation
yarn add react-native-upper
Installation dependencies
yarn add reflect-metadata react-native-quick-sqlite
Usage
import 'reflect-metadata';
import 'react-native-quick-sqlite';
import { Upper } from 'react-native-upper';
import { User } from './src/entities/user.entity';
// ...
const upper = new Upper({
name: 'upper.sllite' // database name,
entities: {
User
}
});
const users = upper.Query('User');
import { Observer } from 'react-native-upper/src/react/Observer'
const Home = () => {
function handleUpdate(){
users.at(0).name = "Upper name" //detect change
}
return (
<View style={styles.container} >
<Observer>
{() => users.map(user => (
<Observer key={user.id}> //update some item list
{() => <Text>{user.name}</Text>}
</Observer>
))}
</Observer>
<Button title="Update name" onPress={handleUpdate} />
</View>
)
}
import {
Field,
PrimaryColumn,
UpperEntity,
} from 'react-native-upper/src/decorators';
@UpperEntity('users')
export class User {
@PrimaryColumn({type: 'uuid'})
id: string;
@Field({type: 'string'})
name: string;
}
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library
0.1.27
2 years ago
0.1.26
2 years ago
0.1.25
2 years ago
0.1.24
2 years ago
0.1.23
2 years ago
0.1.22
2 years ago
0.1.20
2 years ago
0.1.19
2 years ago
0.1.18
2 years ago
0.1.17
2 years ago
0.1.16
2 years ago
0.1.15
2 years ago
0.1.14
2 years ago
0.1.13
2 years ago
0.1.12
2 years ago
0.1.11
2 years ago
0.1.10
2 years ago
0.1.9
2 years ago
0.1.8
2 years ago
0.1.7
2 years ago
0.1.6
2 years ago
0.1.5
2 years ago
0.1.4
2 years ago
0.1.3
2 years ago
0.1.2
2 years ago
0.1.1
2 years ago
0.1.0
2 years ago