@schemeless/event-store-react-native
v2.5.3
Published
React Native compatible build of the [`@schemeless/event-store`](../event-store) runtime. It mirrors the Node.js implementation but swaps the internal queue implementation to [`react-native-better-queue`](https://github.com/YahyaASadiq/react-native-better
Readme
@schemeless/event-store-react-native
React Native compatible build of the @schemeless/event-store runtime. It mirrors the Node.js implementation but swaps the internal queue implementation to react-native-better-queue so it can run inside React Native apps without relying on Node.js file system primitives.
Usage
Install the package from npm and initialise it the same way you would the Node.js runtime:
import { makeEventStore } from '@schemeless/event-store-react-native';All public APIs match the original package, so existing event flows and adapters can be reused. The only difference is the queue dependency, which now targets React Native environments.
React Native prerequisites
Some consumers rely on crypto.getRandomValues (for example the uuid package). React Native apps should polyfill it with react-native-get-random-values:
npm install react-native-get-random-values
npx pod-installIf you use the Expo managed workflow you will see "CocoaPods is not supported in this project"—that is expected and safe to ignore.
Then import the polyfill once at the root of your app (e.g. index.js):
import 'react-native-get-random-values';After this, libraries that depend on crypto.getRandomValues (such as uuid) continue to work as expected.
Development
This package is generated from the Node.js implementation and will be kept in sync as part of the monorepo. Build scripts and test commands mirror the original package:
yarn workspace @schemeless/event-store-react-native compile
yarn workspace @schemeless/event-store-react-native testLicense
MIT
