Giter VIP home page Giter VIP logo

Comments (6)

aadog avatar aadog commented on May 14, 2024 1

它有任何进度吗,或者需要我帮住吗,我也可以提交

from config.

inhere avatar inhere commented on May 14, 2024

保存到文件吗?

from config.

aadog avatar aadog commented on May 14, 2024

大部分情况下都需要可写 有一个onset回调来写回缓存并保存文件 这个库实现很完美 唯独缺了这个 如果有手动保存模式和自动保存模式很好 单独的write太过繁琐了

from config.

inhere avatar inhere commented on May 14, 2024

暂时没有时间改进这个。你能发个PR最好了 👍

from config.

inhere avatar inhere commented on May 14, 2024

添加了一个简单的事件触发。可以看看:

在创建配置时添加钩子函数:

	hookFn := func(event string, c *Config) {
		fmt.Println("fire the:", event)
	}

	c := NewWithOptions("test", WithHookFunc(hookFn))
	// for global config
	config.WithOptions(WithHookFunc(hookFn))

之后, 当调用 LoadXXX, Set, SetData, ClearData 等方法时, 就会输出:

fire the: load.data
fire the: set.value
fire the: set.data
fire the: clean.data

from config.

aadog avatar aadog commented on May 14, 2024

thanks

from config.

Related Issues (20)

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.