1.0.0 • Published 4 years ago

react-native-value v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

react-native-value

Simple manipulate resource to get your fix value.

✨✨ welcome to add your custom function value.

Install

npm install react-native-value

Example to use

import React from 'react';
import { View, Text } from 'react-native';
import Value from 'react-native-value';

export default class App extends React.Component {
    render() {
        const dummy = {
            id : 1,
            name : 'Jhon',
            age : 24
        }
        const dummy2 = {
            id : 1,
            name : null,
            age : 24
        }
        return (
            <View style={{flex : 1, justifyContent : 'center', alignItems : 'center'}}>
                <Text>{Value.getValue(dummy, 'name', 'anonim')}</Text>
                <Text>{Value.getValue(dummy2, 'name', 'anonim')}</Text>
            </View>
        );
    }
}
functionparamsdescription
getValuesource : your custom object, keyValue : your object key, defaultValue : value if keyValue not exist or keyValue is nullfind key value of object