JSPM

litebase-rn-sdk

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q21455F
  • License ISC

Litebase SDK for ReactNative

Package Exports

  • litebase-rn-sdk
  • litebase-rn-sdk/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (litebase-rn-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

LiteBase React Native SDK

RealtimeDataBase

Realtime data comminication on client and server

Expo supported

React Ntaive

import { RealtimeDatabaseMobileClient } from 'litebase-rn-sdk'

const client = new  RealtimeDatabaseMobileClient("<server-url>")
    useEffect(() => {

        //listenting on root item
        client.ref('age').listen((err, data) => {
            if (err) {
                console.log('[ERROR] : ', err)

            }
            else {
                console.log(data);
                setAge(data)
            }
        })
        // listening on in obj 
        client.ref('Example.obj1').listen((err,data) => {
            if (err) {
                console.log('[ERROR] : ', err)
            }
            else {
                setUsername(data)
            }
        })

        // listening list
        client.ref('users').listen((err, data) => {
            if (err) {
                console.log('[ERROR] : ', err)
            }
            else {
                console.log(data);
                setUsers(data)
            }
        })



        return () => {
            client.close()
        }
    }, [])

    const pushUsername = () => {
        // push data
        client.ref('username').push(username)
    }
    const pushAge = () => {
        client.ref('age').push(age)
    }

Push Notification