Git Product home page Git Product logo

joka's People

Contributors

denyskorolkov avatar

Watchers

 avatar

joka's Issues

Implement Joka Core (Handlers)

Set/Get id

({})[id]; generate id or get id;
({})[id] = 'custom id';
`custom id` [set] ({$}, {o})

Using Object

({
    `handler`: {}.
    `handler2`: {}
}) [set] ({o});

Using Array

[
    {},
    {}
] [set] ({o});

Using Scope/Context

`custom handler` [set][call] (scope, )
`custom handler` [set][apply] (scope, [])
`custom handler` [set][scope] (scope, )

Get options & entry

{} [$]
{} [data]
{} [o]
{} [options]

Execute handlers

`handler@3` [exe] (    
    arg1,
    arg2,
    
)

`handler@3` [exe] .call (context, arg1, arg2, )
`handler@3` [exe][call] (context, arg1, arg2, )
`handler@3` [exe][apply] (context, arg1, arg2, )
`handler@3` [exe][scope] (context, arg1, arg2, )

handler

  • If iterable -> events
  • If function -> return
  • If object -> ?
  • If string -> referral
  • If number -> ?

Context

  • Obj -> call
  • String -> get
  • Fun -> post
  • Boolean -> to Boolean
  • Number -> setTimeout or count execute
  • etc

Options

handler @ 1` [o] [ids] .add ()

Destroy entry

`handler@11` [destroy];
`destroy` [exe] (`handler@11`, config)
[set].call(
    Obj -> ids.add()
    String -> get
    Function -> 
    Array
)

[exe].call(
    Obj -> .call(this
    String -> get
    Function -> 
    Array
)

set.add({
    Callback: `new id1`
    Filter: `new id2`
    Count: 0
    Log: {}
})

Events

`on` [exe] (`handler@11`, fun, filter)
`once` [exe] (`handler@11`, …)
`off` [exe] (`handler@11`, …)

Если прикидываем то проставляем в любом случае новый хэндлер
Даже если прикидываем тот который уже существует
А когда делаем off убиваем его

Filter
Object all propertires ok
Array exist
Function
Set

data
If filter == true
Do
Return ext(once, Fun(data))
else
Return

`promise handler` [then] (
    `handler callback`,
    `handler error back`
)

`promise handler` [then] (
    (Function () {}) [id],
    `handler error back`
)

`promise handler` [then] (
    function () {} [id] = `custom function id`,
    `handler error back`
)

`promise handler` [then] (
    `custom function id` [set] (function () {})
    `handler error back`
)

`promise handler`
[then] [scope]
(
    {},
    `handler callback`,
    `handler error back`
)

`then` [exe] (
    `promise handler`,
    `handler callback`,
    `handler error back`
)

`promise rest handler` [fetch] (
    `handler callback`,
    `handler error back`
)

`generator handler` [exe] ()

local

fetch

{
    `global handler #1`: `cloud handler #1`
}

get
post
put
delete
option

`promise policy section` [then] (
    `start view`
)

Замыкать только на примитивы

let id = ({}) [id];
let isHandler = `handler` [is];

let instance = `handler` [$];

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.