IPC
IPCRecord object
Property
Type
Description
id
number
randomly generated id of record
time
number
timestamp (in ms) when this record was made
data
any
content of this record
record.pop()
Remove record from the storage
import { IPC } from '@empathize/framework';
IPC.read().then((records) => {
records.forEach((record) => {
if (record.data == 'test-data')
record.pop(); // Otherwise this record will remain in IPC.read() output
});
});record.get()
Get object of record values
import { IPC } from '@empathize/framework';
IPC.read().then((records) => {
records.forEach((record) => {
if (record.data == 'test-data')
{
// record.pop() method returns this record after its deletion
// and we can call its .get() method after that
const recordData = record.pop().get();
// It will output { id: '...', time: '...', data: '...' }
console.log(recordData);
}
});
});IPC class
IPC.file
File where ipc records should be stored
IPC.read()
Get IPC records
IPC.write(data)
Create record
IPC.remove(record)
Remove record
IPC.purge()
Remove all records
Last updated