Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump foxact from 0.2.39 to 0.2.41 #1078

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Nov 4, 2024

Bumps foxact from 0.2.39 to 0.2.41.

Release notes

Sourced from foxact's releases.

0.2.40

Core Changes

  • Add createLocalStorageState and createSessionStorageState. Example usage:
// src/context/sidebar-active.tsx
import { createLocalStorageState } from 'foxact/create-local-storage-state';
const [useSidebarActive, useSidebarActiveValue] = createLocalStorageState(
'sidebar-active', // The localStorage key
/**

The initial value to use if there is no item in the local storage with the provided key,
the undefined value will be used if no initial value is provided.

Also, the initial value will also be used during the server-side rendering, see below.
/
false,
/*
Optional configuration object enables the customization of value serialization before it's stored in local storage.
*/
{
// Optional, default to false. When set to "true", the value will be passed to the localStorage API as is.
raw: false,
// Optional, default to "JSON.stringify". Can only be specified when the "raw" is set to false (which is the default).
serializer: JSON.stringify,
// Optional, default to "JSON.parse". Can only be specified when the "raw" is set to false (which is the default).
deserializer: JSON.parse,
}
);

export { useSidebarActive, useSidebarActiveValue };

And now you can use the getter and setter hooks anywhere in your app:

// src/components/sidebar.tsx
import { memo } from 'react';
import { useSidebarActive, useSidebarActiveValue } from '../context/sidebar-active';
function Sidebar() {
const [sidebarActive, setSidebarActive] = useSidebarActive();
// If you only need the value, you can use useSidebarActiveValue instead:
const sidebarActive = useSidebarActiveValue();
return (
<div className={sidebar ${sidebarActive ? 'active' : ''}}>
<button onClick={() => setSidebarActive(false)}>Close Sidebar</button>
</div>
</tr></table>

... (truncated)

Changelog

Sourced from foxact's changelog.

0.2.41

  • useComponentWillReceiveUpdate now returns whether the props have changed. You can early return your component to skip the JSX creation, so React can re-execute the component function earlier.

0.2.40

Core Changes

  • Add createLocalStorageState and createSessionStorageState. Example usage:
// src/context/sidebar-active.tsx
import { createLocalStorageState } from 'foxact/create-local-storage-state';
const [useSidebarActive, useSidebarActiveValue] = createLocalStorageState(
'sidebar-active', // The localStorage key
/**

The initial value to use if there is no item in the local storage with the provided key,
the undefined value will be used if no initial value is provided.

Also, the initial value will also be used during the server-side rendering, see below.
/
false,
/*
Optional configuration object enables the customization of value serialization before it's stored in local storage.
*/
{
// Optional, default to false. When set to "true", the value will be passed to the localStorage API as is.
raw: false,
// Optional, default to "JSON.stringify". Can only be specified when the "raw" is set to false (which is the default).
serializer: JSON.stringify,
// Optional, default to "JSON.parse". Can only be specified when the "raw" is set to false (which is the default).
deserializer: JSON.parse,
}
);

export { useSidebarActive, useSidebarActiveValue };

And now you can use the getter and setter hooks anywhere in your app:

// src/components/sidebar.tsx
import { memo } from 'react';
import { useSidebarActive, useSidebarActiveValue } from '../context/sidebar-active';
function Sidebar() {
const [sidebarActive, setSidebarActive] = useSidebarActive();
// If you only need the value, you can use useSidebarActiveValue instead:
const sidebarActive = useSidebarActiveValue();
</tr></table>

... (truncated)

Commits
  • e032fdd release: 0.2.41
  • db768a1 docs(use-component-will-receive-update): update usage
  • 158b4b0 feat(use-component-will-receive-update): return changed boolean
  • af4f96b docs: change sidebar order
  • bc59f8c release: 0.2.40
  • 3044472 feat: atom-like storage state (#26)
  • dd5fe6c docs(use-component-will-receive-update): correct typo (#25)
  • 4b90dba fix: types
  • 2fffd88 chore: housekeeping & make eslint happy
  • See full diff in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [foxact](https://github.com/SukkaW/foxact) from 0.2.39 to 0.2.41.
- [Release notes](https://github.com/SukkaW/foxact/releases)
- [Changelog](https://github.com/SukkaW/foxact/blob/master/CHANGELOG.md)
- [Commits](SukkaW/foxact@0.2.39...0.2.41)

---
updated-dependencies:
- dependency-name: foxact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies javascript Pull requests that update Javascript code labels Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants