Weave Code
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.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata