
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
@meteorrn/local
Advanced tools
This package allows you to store your data locally (similar to GroundDB for Meteor Web).
This package introduces the Local.Collection
, which will mirror the specified remote collection, and store all documents on the device, making your data offline.
remove
on the Local.Collection)import Local from '@meteorrn/local';
const MyLocalCollection = new Local.Collection("name");
MyLocalCollection.find().fetch()
You should use LocalCollection whenever you want to access the stored data. The Local Collection will observe the live collection and automatically update when the live collection does.
A Local.Collection
exposes a property called loadPromise
which resolves once local data has been loaded into the collection. You can use this to control loading flow, like so:
const Todos = new Local.Collection("todos");
class Home extends React.Component {
state = {dataLoading:true};
componentDidMount() {
Todos.loadPromise.then(() => {
this.setState({dataLoading:false});
}).catch(e => {
// Uh oh, an error loading the data.
});
}
}
By default, this package stores each collection in its own AsyncStorage field. If you plan to store very large amounts of data in a collection, consider grouping the data. When you specify a certain field, data will be grouped on this field and stored in separate AsyncStorage fields. If you specify a limit
, the limit will be applied to individual groups instead of the collection as a whole.
Creates a Local Collection that mirrors changes to collection with specified name.
Options:
groupBy (default: null): Specifies a field to organize items on. Items will be grouped into separate AsyncStorage keys by specified limit. If you specifiy a limit, the limit will be applied to each group instead of the collection as a whole
limit (default: -1): Specifies a limit to the number of documents to store. The sort property is required to use this.
sort (default: null): Specifies a sort method to maintain documents by
disableDateParser (default: false): Disables the default behavior when parsing the stringified collection of automatically converting date strings into JS dates
Properties:
A Local.Collection
is a local Mongo Collection that exposes the following additional properties
loadPromise (Promise): A promise that resolves when the local data has been inserted into the collection. While this will typically only take a few hundred milliseconds, if you have UI that depends on the local data, you may want to use this promise in your loading flow.
This package takes advantage of observe and local collections, added in @meteorrn/core@2.0.8
.
FAQs
Store data locally
The npm package @meteorrn/local receives a total of 1 weekly downloads. As such, @meteorrn/local popularity was classified as not popular.
We found that @meteorrn/local demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.