Skip to content

Commit

Permalink
docs: fix createdAt in examples -- has to be unixtime
Browse files Browse the repository at this point in the history
  • Loading branch information
cray0000 committed Jul 4, 2024
1 parent 8366ab4 commit f7cbca1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/guide/react-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const UserProfile = observer(({ userId }) => {
const $user = useSub($.users[userId])

if (!$user.get()) {
throw $user.set({ name: 'New User', createdAt: new Date() })
throw $user.set({ name: 'New User', createdAt: Date.now() })
}

// Rest of your component code
Expand Down Expand Up @@ -86,7 +86,7 @@ const UserProfile = observer(({ userId }) => {
const $editMode = $(false)

if (!$user.get()) {
throw $user.set({ name: 'New User', bio: 'Tell us about yourself', createdAt: new Date() })
throw $user.set({ name: 'New User', bio: 'Tell us about yourself', createdAt: Date.now() })
}

const handleToggleEditMode = () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/teamplay/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ const UserProfile = observer(({ userId }) => {
const $user = useSub($.users[userId])

if (!$user.get()) {
throw $user.set({ name: 'New User', createdAt: new Date() })
throw $user.set({ name: 'New User', createdAt: Date.now() })
}

// Rest of your component code
Expand Down Expand Up @@ -264,7 +264,7 @@ const UserProfile = observer(({ userId }) => {
const $editMode = $(false)

if (!$user.get()) {
throw $user.set({ name: 'New User', bio: 'Tell us about yourself', createdAt: new Date() })
throw $user.set({ name: 'New User', bio: 'Tell us about yourself', createdAt: Date.now() })
}

const handleToggleEditMode = () => {
Expand Down

0 comments on commit f7cbca1

Please sign in to comment.