Skip to content

Support plugins/middlewares #875

Answered by huozhi
scucchiero asked this question in Ideas
Jan 8, 2021 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

@scucchiero thanks for providing your use case, we've had a ongoing RFC about plugins/middleware design, feel free to add any thoughts or releated feature requests there.

for the usage you give above, do you feel the below approach could work?

const {data, error} = useSWR()
const processedData = useMemo(() => {
  return middleware(data) // or you can use any other ways to apply your middlewares
}, [data])

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@scucchiero
Comment options

Answer selected by scucchiero
Comment options

You must be logged in to vote
1 reply
@pke
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
4 participants