From 974896319031dc355bca7b57ed6e3dc2d2e5b482 Mon Sep 17 00:00:00 2001 From: Shahryar Tavakkoli Date: Wed, 3 Jul 2024 08:15:25 +0330 Subject: [PATCH] VIP - Add LiveBook badge link --- README.md | 2 ++ guidance/event/hook.livemd | 14 +++++++------- lib/event/hook.ex | 2 ++ lib/mishka_installer.ex | 2 ++ 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9aae7ce..2a292c5 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,8 @@ Supervisor.start_link(children, opts) > This module is a read-only in-memory storage optimized for the fastest possible read times > not for write strategies. +[![Run in Livebook](https://livebook.dev/badge/v1/pink.svg)](https://livebook.dev/run?url=https%3A%2F%2Fgithub.com%2Fmishka-group%2Fmishka_installer%2Fblob%2Fmaster%2Fguidance%2Fevent%2Fhook.livemd) + ### Plugin management system theory and installation of Elixir libraries at runtime --- diff --git a/guidance/event/hook.livemd b/guidance/event/hook.livemd index 8959398..e68a996 100644 --- a/guidance/event/hook.livemd +++ b/guidance/event/hook.livemd @@ -6,6 +6,10 @@ Mix.install([ ]) ``` +## Solve a possible problem in the execution of sample codes + +> **Should you come into an error such as "you are on another node," it is imperative that you terminate the livebook session associated with this repository and then reopen it.** + ## Build purpose Imagine you are going to make an application that will have many plugins built for it in the future. But the fact that many manipulations will be made on your source code makes it difficult to maintain the application. For example, you present a content management system for your users, and now they need to activate a section for registration and SMS; the system allows you to present your desired input/output absolutely plugin oriented to your users and makes it possible for the developers to write their required applications beyond the core source code. @@ -69,13 +73,6 @@ System.get_env("PROJECT_PATH") OR Application.get_env(:mishka_installer, :projec Should you choose to leave this area unchecked, it is possible that it will evaluate a set of default data for you. While this will not be a problem in the developer environment, it is highly likely that you will see an error when you release the code. -## This part is just for LiveBook not your project - -```elixir -Application.load(:mishka_installer) -{:ok, _} = Application.ensure_all_started(:mishka_installer) -``` - ## Step 1: Create main functions **Consider the following scenario**: @@ -212,6 +209,9 @@ You are no longer required to interact with the parent methods in order to add a ```elixir UserManagement.register(%{mobile: "123456789"}) # {:ok, "Message is sent!"} +``` + +```elixir UserManagement.register(%{mobile: "00000000"}) # {:ok, {:ok, %{mobile: "00000000"}}} ``` diff --git a/lib/event/hook.ex b/lib/event/hook.ex index f6e0253..1cc6159 100644 --- a/lib/event/hook.ex +++ b/lib/event/hook.ex @@ -243,6 +243,8 @@ defmodule MishkaInstaller.Event.Hook do ```elixir use MishkaInstaller.Event.Hook, event: "after_success_login", queue: false ``` + + [![Run in Livebook](https://livebook.dev/badge/v1/pink.svg)](https://livebook.dev/run?url=https%3A%2F%2Fgithub.com%2Fmishka-group%2Fmishka_installer%2Fblob%2Fmaster%2Fguidance%2Fevent%2Fhook.livemd) """ alias MishkaInstaller.Event.{Event, ModuleStateCompiler} diff --git a/lib/mishka_installer.ex b/lib/mishka_installer.ex index 1216aa2..2969728 100644 --- a/lib/mishka_installer.ex +++ b/lib/mishka_installer.ex @@ -108,6 +108,8 @@ defmodule MishkaInstaller do > This module is a read-only in-memory storage optimized for the fastest possible read times > not for write strategies. + [![Run in Livebook](https://livebook.dev/badge/v1/pink.svg)](https://livebook.dev/run?url=https%3A%2F%2Fgithub.com%2Fmishka-group%2Fmishka_installer%2Fblob%2Fmaster%2Fguidance%2Fevent%2Fhook.livemd) + ### Plugin management system theory and installation of Elixir libraries at runtime ---