Created
November 16, 2022 18:05
-
-
Save hamzamu/6898eaa6a7e2282636fc4ca756448321 to your computer and use it in GitHub Desktop.
next.ddp.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Head from 'next/head'; | |
import { useState, useEffect } from 'react'; | |
import 'tailwindcss/tailwind.css'; | |
import DashboardLayout from '../dashboard/layout'; | |
import { createClass } from 'asteroid'; | |
function MyApp({ Component, pageProps }) { | |
// HELLOZ | |
useEffect(() => { | |
const Asteroid = createClass(); | |
// Connect to a Meteor backend | |
const asteroid = new Asteroid({ | |
endpoint: 'ws://localhost:3033/websocket', | |
}); | |
asteroid | |
.call('helloddp') | |
.then((result) => { | |
console.log('Success'); | |
console.log(result); | |
}) | |
.catch((error) => { | |
console.log('Error'); | |
console.error(error); | |
}); | |
}, []); | |
return ( | |
<> | |
<Head> | |
<title>Salvia-kit Dashboard v4 Next.js</title> | |
</Head> | |
<DashboardLayout> | |
<Component {...pageProps} /> | |
</DashboardLayout> | |
</> | |
); | |
} | |
export default MyApp; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment