Socket
Socket
Sign inDemoInstall

react-native-upper

Package Overview
Dependencies
2
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-upper

Simple


Version published
Maintainers
1
Install size
11.1 MB
Created

Readme

Source

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

Keywords

FAQs

Last updated on 20 Oct 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc