Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Crud Bundle Laravel Package

ecommit/crud-bundle

View on GitHub
Deep Wiki
Context7

Callbacks JavaScript

Définition des callbacks

Méthode 1 :

var callback = function (arg) {
    alert('go');
    //...
};

Méthode 2 :

import * as callbackManager from '[@ecommit](https://github.com/ecommit)/crud-bundle/js/callback-manager';

callbackManager.registerCallback('my_callback_name', function (arg) {
    alert('go');
});

Gestion de plusieurs callbacks :

var callbacks = [
    //Callback 1
    function (arg) {
        alert('go');
        //...
    },
    
    //Callback 2
    'my_callback_name' //Callback enregistré par nom (voir méthode 2 plus haut)
];

//Gestion des priorités (priorité par défaut = 0)
var callbacks = [
    //Callback 1
    {
        callback: function (arg) {
            alert('go');
            //...
        },
        priority: 10
    },
    
    //Callback 2
    {
        callback: 'my_callback_name', //Callback enregistré par nom (voir méthode 2 plus haut)
        priority: 20
    }
];

Appel des callbacks

La fonction runCallback doit être appelée avec comme arguments :

  • Callback ou liste de callbacks
  • Argument passé à l'appel de chaque callback

Le premier argument de la fonction runCallback est un callback ou liste de callbacks. Un callback (unique ou parmi le tableau) peut être :

  • 1 callback JavaScript (voir méthode 1 plus haut)
  • 1 nom de callback enregistré par par la méthode registerCallback (voir méthode 2 plus haut)
  • 1 objet avec les propriétés callback et priority (voir plus haut)
import runCallback from '[@ecommit](https://github.com/ecommit)/crud-bundle/js/callback';

//Exemple avec un unique callback
//Voir paragraphe précédent
//var callback = 
runCallback(callback, '5');

//Exemple avec un tableau de callbacks
var callbacks = [
    //... Voir paragraphe précédent
];
runCallback(callbacks, '5');

Exemple avec un callback à plusieurs aguments :

import runCallback from '[@ecommit](https://github.com/ecommit)/crud-bundle/js/callback';

var callback = function (arg1, arg2) {
    var sum = arg1 + arg2;
    alert(sum);
};
runCallback(callback, 10, 5); //Display "15"
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
steadrun/laravel-monitor
labyrinthe/connect-laravel
elmogy/layan
drewdan/sentinel-client
dskripchenko/laravel-llm
fatryst/nuonuo
stevenay/myanfont
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin