The package is a "sentinel" that trigger a function when is visible.
View Preview
·
Report Bug
·
Require Feature
Content Tabel
The package is a "sentinel" that trigger a function when is visible.
To run the project it is just:
- npm
npm install npm@latest -g
-
Install the package
npm install sentineler
ou
yarn add sentineler
-
Import the package
import Sentineler from "sentineler";
-
Call the compoenent and give the callback
<Sentinel callback={() => { console.log("test"); }} />
Example:
import Sentineler from "sentineler"; const App = () => { return ( <Sentinel callback={() => { console.log("test"); }} /> ); }; export default App;
Prop | Type | Default | Description |
---|---|---|---|
callback (required) |
Function | – | Callback function to run when the Sentineler is visible |
I made this infinite scroll using this component.
See the Site Preview: https://taq-challenge.vercel.app
To contribute to the project you just need:
- Clone the repository
git clone https://github.com/OuthBack/sentineler
- Install the packages
ou
npm install
yarn
- For now you can create a link, but soon I will create a react application
yarn link
- In another project that you are using react
yarn link "sentineler"
- Now it is just follow the example
Distributed under the MIT License. See LICENSE
for more information.
Henrique Figueiredo - [email protected]
Project Link: https://github.com/OuthBack/sentineler