README
react-with-native-store (OperationClassification ui-cjs)
One function is all you need to make a new store!
Example:
import { createStore } from "react-with-native-store";
import { TypeA, TypeB } from "your-types";
export const writerInitialValues: {
itemA: TypeA;
itemB: TypeB;
} = {
itemA: "",
itemB: {},
};
export const { useStore, StoreProvider } = createStore(writerInitialValues);
Simple as pie 🍰
Input | ||
---|---|---|
- | ||
Output | { StoreProvider: { }, useStore: { }, } |
One function is all you need to make a new store!
Example:
import { createStore } from "react-with-native-store";
import { TypeA, TypeB } from "your-types";
export const writerInitialValues: {
itemA: TypeA;
itemB: TypeB;
} = {
itemA: "",
itemB: {},
};
export const { useStore, StoreProvider } = createStore(writerInitialValues);
Simple as pie 🍰
Function to create a hook for accessing the store
Input | ||
---|---|---|
- | ||
Output | { } |
If you don't have access to the useStore
hook, maybe because you're doing something outside of react... you can directly use the storage with javascript using this function
Input | ||
---|---|---|
key | string | |
Output |
Function to create a hook for accessing the store
If you don't have access to the useStore
hook, maybe because you're doing something outside of react... you can directly use the storage with javascript using this function
Function to create the StoreProvider
NB: this function uses a local variable on the main scope of javascript in order to create the Context components dynamically. Beware!
Input | ||
---|---|---|
- | ||
Output | { } |
Function to create the StoreProvider
NB: this function uses a local variable on the main scope of javascript in order to create the Context components dynamically. Beware!
Show internal (2)
If you don't have access to the useStore
hook, maybe because you're doing something outside of react... you can directly use the storage with javascript using this function
BEWARE! Updating this won't update your react components!
Input | ||
---|---|---|
key | string | |
Output |
If you don't have access to the useStore
hook, maybe because you're doing something outside of react... you can directly use the storage with javascript using this function
BEWARE! Updating this won't update your react components!
README
react-with-native-store (OperationClassification ui-cjs)
One function is all you need to make a new store!
Example:
import { createStore } from "react-with-native-store";
import { TypeA, TypeB } from "your-types";
export const writerInitialValues: {
itemA: TypeA;
itemB: TypeB;
} = {
itemA: "",
itemB: {},
};
export const { useStore, StoreProvider } = createStore(writerInitialValues);
Simple as pie 🍰
Input | ||
---|---|---|
- | ||
Output | { StoreProvider: { }, useStore: { }, } |
One function is all you need to make a new store!
Example:
import { createStore } from "react-with-native-store";
import { TypeA, TypeB } from "your-types";
export const writerInitialValues: {
itemA: TypeA;
itemB: TypeB;
} = {
itemA: "",
itemB: {},
};
export const { useStore, StoreProvider } = createStore(writerInitialValues);
Simple as pie 🍰
Function to create a hook for accessing the store
Input | ||
---|---|---|
- | ||
Output | { } |
If you don't have access to the useStore
hook, maybe because you're doing something outside of react... you can directly use the storage with javascript using this function
Input | ||
---|---|---|
key | string | |
Output |
Function to create a hook for accessing the store
If you don't have access to the useStore
hook, maybe because you're doing something outside of react... you can directly use the storage with javascript using this function
Function to create the StoreProvider
NB: this function uses a local variable on the main scope of javascript in order to create the Context components dynamically. Beware!
Input | ||
---|---|---|
- | ||
Output | { } |
Function to create the StoreProvider
NB: this function uses a local variable on the main scope of javascript in order to create the Context components dynamically. Beware!
Show internal (2)
If you don't have access to the useStore
hook, maybe because you're doing something outside of react... you can directly use the storage with javascript using this function
BEWARE! Updating this won't update your react components!
Input | ||
---|---|---|
key | string | |
Output |
If you don't have access to the useStore
hook, maybe because you're doing something outside of react... you can directly use the storage with javascript using this function
BEWARE! Updating this won't update your react components!