Pleex
Search…
clearCollection
Remove all data of a collection

removeItem({object to delete} , (success)=> {}, (error)=> {})

How to use:

1
my_collection.clearCollection(
2
() => // removed successfully,
3
(error) => alert(error)
4
);
Copied!

Arguments:

parameter
required
types
success callback
yes
function
failure callback
yes
function

Example:

1
import React,{useEffect} from 'react';
2
import {Text} from 'react-native';
3
import {Pleex} from 'pleex';
4
5
const App = () => {
6
7
// Create collection
8
const my_collection = Pleex.collection('myCollection');
9
10
// Get all data saved
11
my_collection.clearCollection(
12
() => // Success,
13
(error) => alert(error)
14
);
15
16
return (
17
<>
18
<Text>Try clear collection api</Text>
19
</>
20
);
21
22
};
23
24
export default App;
Copied!