Skip to content

Releases: suhaotian/use-one

v1.4.0-beta.1

21 Apr 04:19
Compare
Choose a tag to compare
  • Fix: persistStore wrong when cahce data is null
  • Refactor(examples): refactor examples use new style

v1.4.0-beta.0

19 Apr 12:06
Compare
Choose a tag to compare
  • Feat: persistStore support React Native / Expo

Usage:

import { create, persistStore, wrapState, isClient } from 'use-one';

const initialState = wrapState({ count: 0 }); // -> { ready: false, count: 0 }
const [use, store] = create(initialState);

console.log('isClient', isClient);
isClient && persistStore(store, { key: '@CACHE_KEY', debounce: 100 });

v1.3.0-beta.3

19 Apr 10:27
Compare
Choose a tag to compare
  • Feat: add transform: state => state to persistStore's options

v1.3.0-beta.2

19 Apr 10:04
Compare
Choose a tag to compare
  • Fix types

v1.3.0-beta.1

19 Apr 09:54
Compare
Choose a tag to compare

**Feat: **

  • add persist store, support react-native and web

Usage:

import { create } from 'use-one';
import { persistStore, wrapState, isClient } from 'use-one/persist';

const initialState = wrapState({ count: 0 }); // -> { ready: false, count: 0 }
const [use, store] = create(initialState);

console.log('isClient', isClient);
isClient && persistStore(store, { key: '@CACHE_KEY', debounce: 100 });

v1.2.0-beta.1

22 Feb 00:38
Compare
Choose a tag to compare
  • Feat: support server components

Use different entry with 'react-server': './index.js',
inspired from https://www.npmjs.com/package/server-only?activeTab=code

v1.1.1

19 Dec 13:21
Compare
Choose a tag to compare

Add keywords in package.json

v1.1.0

27 Nov 07:08
Compare
Choose a tag to compare
  • Change .replaceState to .setState
  • Deprecated .replaceState

Publish v1.0.0

19 Jun 23:20
Compare
Choose a tag to compare
  • Breaking Change: createOne rename to create, and deprecated
    createOne

  • Breaking Change: remove setState please use replaceState instead

  • remove tsdx and add bunchee

  • remove MAX_UPDATE_COUNT_NUMBER

  • clean types: syncState and replaceState support oldState => newState

  • export type createOptions => export type CreateOptions

  • add test, e2e tests, and npm auto release github actions

  • update deps and use pnpm

  • add changelog

  • Update README

0.10.1-beta.0 update deps

31 Dec 18:04
Compare
Choose a tag to compare
Pre-release

Now no more manual install eventemitter3,

And remove tsdk bundle replace with bunchee.