Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@app-masters/sync-cache
Advanced tools
## Description Classes for deal with local persistence of data and online synchronization Sync deals with external API and duplicate the data to redux store. At the same time, can have unsynchronized data on local storage.
Classes for deal with local persistence of data and online synchronization Sync deals with external API and duplicate the data to redux store. At the same time, can have unsynchronized data on local storage.
On the App.js
, import and give desired model list to setup./
import { AmSync, AmSyncCache } from '@app-masters/sync-cache';
...
// Custom conflict rule (Priories newest object)
const conflictRule = (cacheObject, onlineObject) => {
const dateCache = new Date(cacheObject.updatedAt).getDate();
const dateOnline = new Date(onlineObject.updatedAt).getDate();
if (dateCache < dateOnline) {
return onlineObject;
} else {
return cacheObject;
}
};
// Default config for USER actions
const userReduxConfig = {
validateObject: () => {}, // required
prepareToServer: (item) => item,
prepareToClient: (item) => item,
conflictRule: conflictRule,
typePrefix: 'USER', // required
endPoint: '/users/', // required
cacheStrategy: 'CacheOnline',
createSuffix: '',
updateSuffix: '',
deleteSuffix: '',
primaryKey: '_id'
};
AmSyncCache.setStorage(storage); // using @app-masters/realm-async-storage
const UserActions = new AmSync(userReduxConfig);
Most of the methods are called by redux as redux-thunk
actions.
For synchonization, some methods are available on each instance, not requiring to be called as a redux action.
_cacheCreatedAt
and sync it with API_cacheUpdatedAt
and sync it with API_cacheDeletedAt
and sync it with APIFor running the tests, you can run a local API for integration tests. On another CLI, make API available on port 3000 with running the script:
$ cd api
$ npm run dev
[0.4.1] - 2018-12-20
FAQs
## Description Classes for deal with local persistence of data and online synchronization Sync deals with external API and duplicate the data to redux store. At the same time, can have unsynchronized data on local storage.
The npm package @app-masters/sync-cache receives a total of 12 weekly downloads. As such, @app-masters/sync-cache popularity was classified as not popular.
We found that @app-masters/sync-cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.