Skip to content

Commit

Permalink
chore(examples): add getContext in 05_actions (#584)
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi authored Mar 9, 2024
1 parent f985f59 commit 9e0cfc2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions examples/05_actions/src/components/funcs.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
'use server';

import { rerender } from 'waku/server';
import { rerender, getContext } from 'waku/server';

export const greet = (name: string) => `Hello ${name} from server!`;
export const greet = (name: string) => {
console.log('RSC Context:', getContext()); // ---> {}
return `Hello ${name} from server!`;
};

// module state on server
let counter = 0;
Expand Down

0 comments on commit 9e0cfc2

Please sign in to comment.