0.0.53 • Published 2 months ago

suspense v0.0.53

Weekly downloads
5
License
MIT
Repository
github
Last release
2 months ago

suspense

APIs to simplify data loading and caching. Primarily intended for use with React Suspense.

⚠️ Considerations

  1. Suspense is an experimental, pre-release feature; these APIs will change along with React.
  2. This package depends on react@experimental and react-dom@experimental versions.

If you like this project, 🎉 become a sponsor or ☕ buy me a coffee

Example

import { createCache } from "suspense";

const userProfileCache = createCache({
  load: async ([userId]) => {
    const response = await fetch(`/api/user?id=${userId}`);
    return await response.json();
  },
});

function UserProfile({ userId }) {
  const userProfile = userProfileCache.read(userId);

  // ...
}

More examples at suspense.vercel.app.

If you like this project, buy me a coffee.

0.0.53

2 months ago

0.0.52

5 months ago

0.0.51

6 months ago

0.0.50

6 months ago

0.0.49

7 months ago

0.0.40

11 months ago

0.0.41

11 months ago

0.0.42

11 months ago

0.0.43

11 months ago

0.0.44

11 months ago

0.0.45

10 months ago

0.0.46

10 months ago

0.0.47

10 months ago

0.0.38

12 months ago

0.0.39

11 months ago

0.0.48

8 months ago

0.0.20

1 year ago

0.0.21

1 year ago

0.0.22

1 year ago

0.0.23

1 year ago

0.0.24

1 year ago

0.0.25

1 year ago

0.0.37

1 year ago

0.0.15

1 year ago

0.0.16

1 year ago

0.0.17

1 year ago

0.0.18

1 year ago

0.0.19

1 year ago

0.0.30

1 year ago

0.0.31

1 year ago

0.0.32

1 year ago

0.0.10

1 year ago

0.0.33

1 year ago

0.0.11

1 year ago

0.0.34

1 year ago

0.0.12

1 year ago

0.0.35

1 year ago

0.0.13

1 year ago

0.0.36

1 year ago

0.0.14

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.26

1 year ago

0.0.9

1 year ago

0.0.27

1 year ago

0.0.8

1 year ago

0.0.28

1 year ago

0.0.29

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.1

6 years ago

0.0.0

6 years ago