
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
native-store
Advanced tools
Native store for react-native
Run npm install --save native-store
to add the package to your app's dependencies.
Run react-native link native-store
so your project is linked against your Xcode project and all CocoaPods dependencies are installed.
node_modules/native-store/ios/TPSStore/
Add Files to "Your Project Name"
.node_modules/native-store/ios
and add TPSStore.xcodeproj
.libTPSStore.a
to Build Phases
-> Link Binary With Libraries
.TPSStore.xcodeproj
in Libraries and go the Build Settings tab. Double click the text to the right of Header Search Paths
and verify that it has $(SRCROOT)/../../react-native/React
- if they aren't, then add them. This is so Xcode is able to find the headers that the TPSStore
source files are referring to by pointing to the header files installed within the react-native
node_modules
directory.import Storage from 'native-store'
Run react-native link native-store
so your project is linked against your Android project
In your app build.gradle
add:
...
dependencies {
...
compile project(':native-store')
}
In your settings.gradle
add:
...
include ':native-store'
project(':native-store').projectDir = new File(rootProject.projectDir, '../node_modules/native-store/android')
Let's require native-store
module:
import Storage from 'native-store'
To change store
state from React use:
Storage.setState({...})
To get the current state of native store
use:
const state = await Storage.getState()
To subscribe on store
state changes use:
this.unsubscribe = Storage.subscribe(this.yourFunction)
As a result you will get unsubscribe
function.
Don't forget to unsubscribe, typically you can do it in componentWillUnmount
componentWillUnmount() {
this.unsubscribe()
}
To run native-store
unit tests and example
app e2e tests for all platforms you can use npm run ci
command.
cd example
npm install
npm run build:ios
- for iOSnpm run build:android
- for Androidnpm run build
- for both iOS and Androidnpm run appium
npm run test:ios
- for iOSnpm run test:android
- for Androidnpm run test
- for both iOS and AndroidYou might encounter the following error while trying to run tests:
An unknown server-side error occurred while processing the command. Original error: Command \'/bin/bash Scripts/bootstrap.sh -d\' exited with code 1
You can fix it by installing Carthage
:
brew install carthage
To see more of the native-store
in action, you can check out the source in example folder.
native-store is available under the MIT license. See the LICENSE file for more info.
FAQs
Native store for react-native
The npm package native-store receives a total of 0 weekly downloads. As such, native-store popularity was classified as not popular.
We found that native-store demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.