Skip to content

v0.10.0

Compare
Choose a tag to compare
@maradotwebp maradotwebp released this 05 Mar 23:10
· 211 commits to main since this release

What's Changed

  • BlinkDB introduces middleware! Hook right into BlinkDB methods with the new use() method, which lets you modify parameters & return values of various functions of BlinkDB. See the docs for more details.
use(userTable, async (ctx) => {
  // Execute code before calling the implementation
  console.log(ctx.action); // Log the method called
  console.log(ctx.params); // Log parameters given to the method

  // Call the native implementation
  const result = await ctx.next(...ctx.params);

  // Execute code after the implementation
  console.log("Everything worked!");

  // Don't forget to return the result ;)
  return result;
})