
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@bbc/search-complete-react
Advanced tools

Logo - Diego Naive, Noun Project.
npm install @lauf/store-react --save
@lauf/store-react enables React apps to use @lauf/store
for state-management, providing a simple substitute for Flux/Redux based on
Immer.
Browse the API or the Typescript example inlined below from our Counter App.
The Counter example below shows how useSelected binds a selected part of a
Store's state to a component, and how events can edit the state.
You can see the app running in an online sandbox; in javascript, or in typescript.
AppState defines the state structure for the Store.StoreProps passes the Store to React components.Display React component has a useSelected hook to re-render when counter changes.Increment and Decrement buttons don't re-render on any state changes, but they DO trigger an edit to the counter state when clicked.App calls useStore passing in an INITIAL_STATE to initialise a Store on first load.App inserts the three components, passing each one the store to do its work.import React from "react";
import ReactDOM from "react-dom";
import { Store, Immutable } from "@lauf/store";
import { useStore, useSelected } from "@lauf/store-react";
interface AppState {
counter: number;
}
const INITIAL_STATE: Immutable<AppState> = {
counter: 0,
} as const;
interface StoreProps {
store: Store<AppState>;
}
const Display = ({ store }: StoreProps) => {
const counter = useSelected(store, (state) => state.counter);
return <h1>{counter}</h1>;
};
const Increment = ({ store }: StoreProps) => (
<button onClick={() => store.edit((draft) => (draft.counter += 1))}>
Increase
</button>
);
const Decrement = ({ store }: StoreProps) => (
<button onClick={() => store.edit((draft) => (draft.counter -= 1))}>
Decrease
</button>
);
const App = () => {
const store = useStore(INITIAL_STATE);
return (
<>
<Display store={store} />
<Increment store={store} />
<Decrement store={store} />
</>
);
};
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById("root")
);
FAQs
UI agnostic autocomplete engine for BBC search
The npm package @bbc/search-complete-react receives a total of 0 weekly downloads. As such, @bbc/search-complete-react popularity was classified as not popular.
We found that @bbc/search-complete-react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 18 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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.