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

@stenajs-webui/redux

Package Overview
Dependencies
Maintainers
3
Versions
462
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stenajs-webui/redux

This package contains utilities that can help creating Redux features.

  • 0.0.39
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
425
decreased by-57.03%
Maintainers
3
Weekly downloads
 
Created
Source

stenajs-webui/redux

This package contains utilities that can help creating Redux features.

commit-reducer

This makes it easy to have a state split into workspace and committed state.

This can be useful when editing a form, which uses workspace state. When user presses enter, it is committed.

A search query is built from committed state, and thus, the search is triggered when the commit occurs, instead of on every keystroke.

Reducer
export const timeTableFilterReducer = createCommitReducer<
  TimeTableFilterState
>("timeTableFilter", {
  workspace: INITIAL_STATE,
  committed: INITIAL_STATE
});
  • First argument is the id of the reducer. (You can have multiple)
  • Second argument is initial state, which must be { workspace: X, committed: Y }.
  • X can be the same as Y, but it is not required.
Actions
export const { setValues, commitValues, clearValues } = createCommitReducerActions<TimeTableFilterState>(
  "timeTableFilter"
);

// In component
const dispatch = useDispatch();
dispatch(setValues({ email: 'tomte@nordpolen.se' }));

  • The first argument is the id of the reducer.
Selectors
export const { getWorkspaceValues, getCommittedValues } = createCommitReducerSelectors<
  StoreState,
  TimeTableFilterState
>(state => state.timeTableFilter, "timeTableFilter");

// In component
const filterValues = useSelector(getWorkspaceValues);

  • First argument is the id of the reducer.
  • Second argument is a selector which selects the reducers state from global store state.

FAQs

Package last updated on 01 Oct 2019

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