New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-reuix

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-reuix

A redux-like store system for react navite Reanimated 2 shared values

  • 1.0.3
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-native-reuix

A redux-like store system for React Native Reanimated 2 shared values

Prerequisites

This module needs

React Native Reanimated 2 to work, first make sure you have this package installed

Installation

Using Yarn

yarn add react-native-reuix

Using npm

npm install react-native-reuix

Usage

1. Create a Store

export const sharedValueStore = createSharedValueStore({
  initialState: {
    testOpacity: 0.5,
  },
  actions: {
    setTestOpacity(state, payload: number) {
      state.testOpacity = payload;
    },
  },
});

2. Wrap Your App With SharedValueStoreProvider and Pass Your Store

export default function App() {
  return (
    <SharedValueStoreProvider store={sharedValueStore}>
      <TestView />
    </SharedValueStoreProvider>
  );
}

3. Read Values From Store

Get the store using useSharedValueStore hook

const sharedValueStore = useSharedValueStore<TestStoreType>();

Then you can freely read values from store

sharedValueStore.value.testOpacity

4. Dispatch Actions to Change Values

Get the dispatcher using useSharedValueDispatch hook

const sharedValueDispatch = useSharedValueDispatch<TestStoreType>();

Dispatch actions to change values

sharedValueDispatch('setTestOpacity', 1);

Rest

Rest of the docs are coming soon

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Keywords

FAQs

Package last updated on 21 Apr 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc