
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@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
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 45 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 researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.